Created
February 20, 2015 19:25
-
-
Save echohack/d42bb1ed6d3129461136 to your computer and use it in GitHub Desktop.
Set DSC LocalConfigurationManager with Chef
This file contains hidden or 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
# Apply the Local Configuration Manager for DSC. | |
# DSC by default runs a consistancy check once every 15 minutes. | |
# We disable this because it causes collisions with chef-client runs. | |
powershell_script 'apply_lcm' do | |
code <<-EOH | |
configuration LCM | |
{ | |
LocalConfigurationManager | |
{ | |
ConfigurationMode = "ApplyOnly" | |
} | |
} | |
LCM -OutputPath #{Chef::Config['file_cache_path']} | |
Set-DscLocalConfigurationManager -Path #{Chef::Config['file_cache_path']} | |
EOH | |
not_if '(Get-DscLocalConfigurationManager).ConfigurationMode -eq "ApplyOnly"' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment