Skip to content

Instantly share code, notes, and snippets.

@awaxa
Created August 20, 2014 21:30
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 awaxa/1567c384d590a2402b94 to your computer and use it in GitHub Desktop.
Save awaxa/1567c384d590a2402b94 to your computer and use it in GitHub Desktop.
class included {
file { '/tmp/testfile':
ensure => 'file',
}
}
class my::one {
File {
mode => '0440',
}
include included
}
class my::three {
File {
mode => '0660',
}
include included
}
class my::two {
File {
mode => '0400',
}
include included
}
include my::two
include my::one
include my::three
/*
Notice: Compiled catalog for greg.puppetlabs.vm in environment production in 0.09 seconds
Notice: /Stage[main]/Included/File[/tmp/testfile]/mode: mode changed '0644' to '0400'
Notice: Finished catalog run in 0.08 seconds
# ls -l /tmp/testfile
-r-------- 1 root root 0 Aug 20 21:16 /tmp/testfile
*/
@awaxa
Copy link
Author

awaxa commented Aug 20, 2014

https://docs.puppetlabs.com/puppet/latest/reference/lang_defaults.html#behavior
"Although Puppet 3.x no longer does dynamic variable lookup, it still uses dynamic scope for resource defaults."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment