Skip to content

Instantly share code, notes, and snippets.

@vinyar
Created May 10, 2014 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinyar/797a5e9f77585da6a167 to your computer and use it in GitHub Desktop.
Save vinyar/797a5e9f77585da6a167 to your computer and use it in GitHub Desktop.
Troubleshooting idempotence with registry_key resource on chef 11.8.0
Attribute file:
default['winsecureos']['registry']['eventlog']['HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application'] =
[
{:name => 'MaxSize', :type => :dword, :data => '20971520'},
{:name => 'RestrictGuestAccess', :type => :dword, :data => '1'},
{:name => 'Retention', :type => :dword, :data => '1'},
{:name => 'AutoBackupLogFiles', :type => :dword, :data => '1'}
]
Recipe:
node['winsecureos']['registry'].each do |kind, array|
array.each do |key, hash|
hash.each do |value|
registry_key kind + key + value.to_s do
key key
values [{
:name => value.name,
:type => value.type,
:data => value.data
}]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment