DSC Feature Request

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Arie H Arie H 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35510
    Profile photo of Aaron Stainback
    Aaron Stainback
    Participant

    Where can I go to request a feature be added to DSC. I really need the ability to trigger certain things happening when a test-targetresource is triggered. I'm having to create my own resources a lot when I could have used an existing one if I had the ability to trigger my own code when for instance the File resource test-targetresource is triggered I want to kill certain processes so it will not fail with file in use errors.

    #35511
    Profile photo of Zuldan
    Zuldan
    Participant
    #35514
    Profile photo of Arie H
    Arie H
    Participant

    Hi,

    Have you tried using DependsOn on the File Resource to depend on a Service Resource where you implement Status = Off or similar ?

    I doubt there will be an api or hook into the set-get-test structure of the Resource to add your code, but i think with DependsOn and perhaps even WaitFor Resource you might be able to do some orchestration.

    From my perspective DSC isnt a full IAC, as it lacks the orchestration but you can implement workflow in powershell to build a bigger solution that will fit.

    Arie H.

    #35545
    Profile photo of Aaron Stainback
    Aaron Stainback
    Participant

    Arie H I cannot accomplish my above request with either DependsOn or WaitFor. If you know something I don't please put up a sample. Specifically I'm looking to "upgrade" a service. This really just involves copying the new files for the service the problem is I first need to stop the service or else I get files in use.

    #35559
    Profile photo of Arie H
    Arie H
    Participant

    Hi Aaron,

    Don't you know the name of the service the updated files are part of ?
    Unless I missed something this should fill the need to "upgrade" a service.

    Service MyService
    {
    Ensure='Present'
    State='Stopped'
    }

    Folder MyNewServiceFiles
    {
    Ensure='Present'
    Type='Folder'
    Recursive=$true
    Source='path to source'
    Target='path to target'
    DependsOn='[Service]MyService'
    }

    This will stop the service and not start copying the new files until the service is stopped

    Once that was done, just issue a new DSC script to activate the service.
    As I mentioned above, DSC lacks the orchestration and you need to adjust around it.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.