DSC Feature Request

Welcome Forums DSC (Desired State Configuration) DSC Feature Request

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
2 years, 12 months ago.

  • Author
    Posts
  • #35510

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member
  • #35514

    Participant
    Points: -19
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: -19
    Rank: Member

    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.

The topic ‘DSC Feature Request’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort