Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Managing DSC Resources

    Scheduled Pinned Locked Moved Support
    buildmasterotter
    2 Posts 1 Posters 9 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I would like to use DSC resources to handle things that the "out of the box" actions do not cover, specifically, NTFS permissions after an "ensure directory" call and managing some repository registrations.

      In order to use a DSC module, I am assuming that the module must be installed on the Otter server, but do I have to install it on the target server or will Otter handle that? Is there some other action that must be taken to make sure that I am able to leverage that DSC resource?

      Product: BuildMaster
      Version: 6.0.4

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Hi Paul,

        Your best bet would probably be to use Role Dependencies - the parent role would ensure that the module is installed:

        # Parent Role
        PSEnsure
        (
            Key: InstallDSC,
            Value: 0,
            Collect: "if(Get-Module -Name cNtfsAccessControl -List -ErrorAction SilentlyContinue) { exit 0 } else { exit -1 }",
            Configure: install-module -Name cNtfsAccessControl -Force,
            UseExitCode: true
        );
        

        Then, in the dependent role, you can safely use the module:

        # Dependent Role
        PSDsc cNtfsAccessControl::cNtfsPermissionsInheritance
        (
            Otter_ConfigurationKey: ApplyPermissions_Key,
            Path: c:\temp,
            PreserveInherited: true,
            Enabled: true
        );
        

        Note that this usage of Role Dependencies will require Otter 2.0.8 or later. In any case, if you don't want to or can't use Role Dependencies, you can simply put the PSEnsure operation inside an alwaysExecute block.

        Does this help?

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation