Can I subscribe to multiple files in a exec block, i.e.,
exec { "puppet restart":
subscribe => File["puppet.conf"],
subscribe => File["/etc/sysconfig/puppet"],
refreshonly => true,
command => "service puppet restart",
}
Cheers,
Jeff
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On Wed, Jun 25, 2008 at 12:19 PM, Jeff <joesiege@gmail.com> wrote:> > Can I subscribe to multiple files in a exec block, i.e., > > exec { "puppet restart": > subscribe => File["puppet.conf"], > subscribe => File["/etc/sysconfig/puppet"], > refreshonly => true, > command => "service puppet restart", > } > > Cheers, > JeffTry it more like this: exec { "puppet restart": subscribe => [ File["puppet.conf"], File["/etc/sysconfig/puppet"] ] refreshonly => true, command => "service puppet restart", } The same format also goes for require and notify. Even better atleast for handling puppet would be: service{"puppet": ensure => running, enable => true, hasrestart => true, hasstatus => true, subscribe => [ File["puppet.conf"], File["/etc/sysconfig/puppet"] ] } Of course the has status assumes you are running RHEL style service command. This has the main advantage of being the puppet way to do things and has some better builtin features such as making sure puppet is running in the first place and stays running. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jeff,
Yes.
You pass an array of the items instead of a single item (and instead
of using subscribe twice), i.e.,
exec { "puppet restart":
subscribe => [
File["puppet.conf"],
File["/etc/sysconfig/puppet"]
],
refreshonly => true,
command => "service puppet restart"
}
You can put both of those on a single line after the subscribe; the
important bit is the []s around the two File[]s; I just prefer the
formatting with those split out like that, especially since it works a
lot better when there''s more than just 2 of them.
On Jun 25, 2008, at 10:19 AM, Jeff wrote:
>
> Can I subscribe to multiple files in a exec block, i.e.,
>
> exec { "puppet restart":
> subscribe => File["puppet.conf"],
> subscribe => File["/etc/sysconfig/puppet"],
> refreshonly => true,
> command => "service puppet restart",
> }
>
> Cheers,
> Jeff
> >
>
--
Eric Eisenhart <eric.eisenhart@sonoma.edu>
Lead Unix/Linux System Administrator
1.707.664.3099
Sonoma State University, Information Technology
Jabber/XMPP: eisenhae@jabber.sonoma.edu
AIM: ericeisenhart
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Jeff wrote:> Can I subscribe to multiple files in a exec block, i.e., > > exec { "puppet restart": > subscribe => File["puppet.conf"], > subscribe => File["/etc/sysconfig/puppet"], > refreshonly => true, > command => "service puppet restart", > }Yes. Not just in an exec block and not just for subscribe, this can be generalized for anything: subscribe => [ File["puppet.conf"], File["/etc/sysconfig/puppet"] ]; --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---