Created
November 23, 2016 16:14
-
-
Save brettski/71be30ac33cf90b8d7b52bcacfd48c91 to your computer and use it in GitHub Desktop.
Lcm recipe, how to stub the not_if?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell_script 'Configure the LCM' do | |
code <<-EOH | |
Configuration ConfigLCM | |
{ | |
Node "localhost" | |
{ | |
LocalConfigurationManager | |
{ | |
ConfigurationMode = "ApplyOnly" | |
RebootNodeIfNeeded = $false | |
} | |
} | |
} | |
ConfigLCM -OutputPath "#{Chef::Config[:file_cache_path]}\\DSC_LCM" | |
Set-DscLocalConfigurationManager -Path "#{Chef::Config[:file_cache_path]}\\DSC_LCM" | |
EOH | |
not_if '(Get-DscLocalConfigurationManager |select -ExpandProperty "ConfigurationMode") -eq "ApplyOnly"' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment