Matt Zagrabelny
2012-Mar-23 16:24 UTC
[Puppet Users] default "notify" directive for files in a directory
Hi, I know there is a way to have global options using things like: site.pp: File { owner => "root", group => "root", mode => 0644, } -- Is there a way to have something like: File[/etc/daemon/config.d/*] { notify => Class["daemon::service"], } ?? I would like to have the same "notify" directive for any file resource that falls under the path "/etc/daemon/config.d". The reason why I would like to do it this way is that I have config files (/etc/daemon/config.d/config_option_1) for said daemon spread out. For instance, some of them live within modules, others are in the private fileserver namespace. It would reduce directive clutter if there was a way to say, "Any file living under /etc/daeomn/config.d" has a default notify of ''Class["daemon::service"],''. Thanks for the advice. Sincerely, -matt zagrabelny -- 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.
Denmat
2012-Mar-23 23:25 UTC
Re: [Puppet Users] default "notify" directive for files in a directory
Hi Matt, No, not like that. You can group all these files under a module for that service and inside the class for configuring those files create a default. class blah::service { service {''blah'': .....} } class blah::files { File { notify => Service[''blah''] } file {''/etc/path/file'': ..... } } Something like that. I can remember if that is safe (ie, that defaults stay within the scope of the class). You might want to check to see if the docs mention anything about it before implementing. Den On 24/03/2012, at 3:24, Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:> Hi, > > I know there is a way to have global options using things like: > > site.pp: > > File { > owner => "root", > group => "root", > mode => 0644, > } > > -- > > Is there a way to have something like: > > File[/etc/daemon/config.d/*] { > notify => Class["daemon::service"], > } > > ?? > > I would like to have the same "notify" directive for any file resource > that falls under the path "/etc/daemon/config.d". > > The reason why I would like to do it this way is that I have config > files (/etc/daemon/config.d/config_option_1) for said daemon spread > out. For instance, some of them live within modules, others are in the > private fileserver namespace. It would reduce directive clutter if > there was a way to say, "Any file living under /etc/daeomn/config.d" > has a default notify of ''Class["daemon::service"],''. > > Thanks for the advice. > > Sincerely, > > -matt zagrabelny > > -- > 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. >-- 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.