1

I would like to use DSC to check and correct Service resources as State = Running. The issue is that these services don't exist until I have manually run a software installer on the target node. I am already using DSC to prepare the node for installation of this software.

So in other words, I have a node where I do some configuration, then I have a manual software installation that DependsOn that configuration, and then I have a Service resource that DependsOn the manual software installation.

In theory, I could automate the software installation in a custom or Script resource, and then create the dependency chain I described, but in practice, I don't yet have the time to create that automation. (It's a long-term goal.) So instead, I want to apply the first part of the configuration, manually install the software, and then allow the last part of the configuration to apply.

What's the least bad way of making this happen? I know I could create two separate configurations for the "before" and "after" phase, but I think it would be better to have one configuration that could be enhanced with an automatic installation procedure later. Currently I'm considering using a Script resource that checks for some semaphore/file on disk and errors out in the SetScript, but I haven't yet done a proof-of-concept for this strategy.

NReilingh
  • 484
  • 3
  • 9
  • 24
  • Just curious, why would your `SetScript` error out upon finding the semaphore? Does its existence mean that the software is installed? If so, you check for it in the `TestScript`, and if that returns `True` then `Set` is never run. – briantist Feb 03 '20 at 04:11
  • 1
    @briantist The `SetScript` would error on purpose if `TestScript` returns false upon _not_ finding the semaphore. Then I would set the semaphore manually after running the installation process. Then, a future run of the configuration would have `TestScript` return true, so the configuration could continue with the resources that depend on the script resource. – NReilingh Feb 03 '20 at 17:49
  • I see; that's one option. You could also just let the future steps (configuring the service) fail naturally, but maybe that would give confusing output or have side effects? – briantist Feb 03 '20 at 21:09

0 Answers0