Global resources options
Often, all resources of one type (file, package, service etc.) in one manifest have few common options. Instead of writing many strings of repetitive code like this:
file { "foo":
ensure => file,
mode => 600
# some other code
}
file { "bar":
ensure => file,
mode => 600
# some other code
}
file { "some_file":
ensure => file,
mode => 600
# some other code
}
better set common options for all resources of one type in current class:
File {
mode => 600
}
NOTE: name of type begins with a capital letter
This will produce better readability and less unnecessary code.
Written by Jeny
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Puppet
Authors
Related Tags
#puppet
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#