Christopher Johnston
2010-Aug-13 22:48 UTC
[Puppet Users] Question about types and using a default/inherited value
I have some types like below that have about 10 files or directories in a
single type to keep my manifests looking clean and easier to maintain.
Since some of them all use the same options (user, group, mode, etc) with
the same values is there a way to set them globally once and have all of
them get inherited so I don''t have to repeat entries?
file {
''/etc/nsswitch.conf'':
owner => root,
group => root,
mode => 0644,
file => ''sssd/files/nsswitch.conf'';
''/etc/pam.d/system-auth-ac'':
owner => root,
group => root,
mode => 0644,
file => ''sssd/files/system-auth-ac'';
}
Thinking something like this, where the value of default forces anything
that does not have user, group or mode specified to inherit those values as
a default. Then if something is present it will override the default
attributes. I would imagine this would be a feature request if this is not
supported in some fashion. Interested to hear peoples thought as this would
save a lot of typing and clutter in the my manifests (which are quite big as
we have some servers that require a tone of directories and symlinks)
file {
''default'':
owner => root,
group => root,
mode => 0644;
''/etc/nsswitch.conf'':
source => ''sssd/files/nsswitch.conf'';
mode => 0755;
''/etc/pam.d/system-auth-ac'':
source => ''sssd/files/system-auth-ac'';
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Avi Miller
2010-Aug-13 22:52 UTC
Re: [Puppet Users] Question about types and using a default/inherited value
Hi Chris, On 14/08/2010, at 8:48 AM, Christopher Johnston wrote:> Since some of them all use the same options (user, group, mode, etc) with the same values is there a way to set them globally once and have all of them get inherited so I don''t have to repeat entries?Yes: File { owner => "root", group => "root", mode => "0644", } Will set the defaults as per your example. Cheers, Avi -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Avi Miller
2010-Aug-13 22:54 UTC
Re: [Puppet Users] Question about types and using a default/inherited value
Hi Chris, On 14/08/2010, at 8:48 AM, Christopher Johnston wrote:> Since some of them all use the same options (user, group, mode, etc) with the same values is there a way to set them globally once and have all of them get inherited so I don''t have to repeat entries?Yes: File { owner => "root", group => "root", mode => "0644", } Will set the defaults as per your example. Cheers, Avi -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.