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
-
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 -
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?
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