DSC interactions with Powershell Workflows

This topic contains 2 replies, has 2 voices, and was last updated by  Kamran Safavi 3 years, 7 months ago.

  • Author
  • #21290

    Kamran Safavi

    I am using Powershell workflows for orchestration, and would like to have some interactions between DSC and external workflows. I am thinking about creating a custom resource that would allow DSC to communicate with orchestration scripts similar to the way the new inter-node dependency feature has been implemented in WMF 5.

    My initial thought is that a DSC configuration could use the custom resource to send a message to the external workflow, such as run such and such workflow. If the workflow completes successfully the state would be saved in a db or something and the next time DSC runs the config the custom resource would check the state to see if the workflow ran successfully and if so, would not send the message again.

    If anybody has any suggestions on how to integrate DSC with external workflows it would be greatly appreciated 🙂

  • #21295

    Don Jones

    Yeah, I suppose you could do that. It wouldn't really fit well with the way DSC works. The assumption on the part of the LCM is that, when it runs a "Set" command, the "whatever" gets set right then, not later. You'd need to put some logic in place to ensure you didn't run the workflow multiple times in parallel because the LCM checked back in before the first instance was done.

    And I'm not sure saving state to a DB would be valid. What if the DB got changed, but the underlying configuration didn't? What if (more likely) someone diddled with the underlying config, but the DB still said everything was kosher? The point of DSC is that it checks the facts on the ground, not a configuration database, to determine compliance.

  • #21301

    Kamran Safavi

    "The point of DSC is that it checks the facts on the ground, not a configuration database, to determine compliance."

    Thanks. That's a good point.

You must be logged in to reply to this topic.