Simple question
If a file changes and it notify a service, will the service be restarted? If
not do I need to create a exec? (which I have right now)
below is what I have in mind:
it this correct? thanks!
file { "named.conf" :
path => "/var/named/etc/name.conf",
mode => 0444, owner => named, group => named,
notify => Service[ "named::server ]
}
service { "named::server" :
name => $operatingsystem ? {
centos => "named",
ubuntu => "bind9",
solaris => "named".
}.
enable => true,
ensure => running,
}
--
-ls
--
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.
Stephen McNally
2010-Sep-23 17:19 UTC
Re: [Puppet Users] Does a service call trigger a restart?
It''s my understanding that as long as you have the ensure => running line in your service definition, a notify will restart it. As an alternative you could add the subscribe => File["named.conf"] to your service definition. -Stephen On Thu, Sep 23, 2010 at 1:01 PM, Luc Suryo <lsuryo@gmail.com> wrote:> Simple question > > If a file changes and it notify a service, will the service be restarted? > If not do I need to create a exec? (which I have right now) > below is what I have in mind: > > it this correct? thanks! > > > file { "named.conf" : > path => "/var/named/etc/name.conf", > mode => 0444, owner => named, group => named, > notify => Service[ "named::server ] > } > > > service { "named::server" : > name => $operatingsystem ? { > centos => "named", > ubuntu => "bind9", > solaris => "named". > }. > enable => true, > ensure => running, > } > > -- > -ls > > -- > 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<puppet-users%2Bunsubscribe@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.
thanks! just wanted to be sure On Thu, Sep 23, 2010 at 10:19 AM, Stephen McNally <stephentmcnally@gmail.com> wrote:> It''s my understanding that as long as you have the ensure => running line > in your service definition, a notify will restart it. As an alternative you > could add the subscribe => File["named.conf"] to your service definition. > > -Stephen > > On Thu, Sep 23, 2010 at 1:01 PM, Luc Suryo <lsuryo@gmail.com> wrote: > >> Simple question >> >> If a file changes and it notify a service, will the service be restarted? >> If not do I need to create a exec? (which I have right now) >> below is what I have in mind: >> >> it this correct? thanks! >> >> >> file { "named.conf" : >> path => "/var/named/etc/name.conf", >> mode => 0444, owner => named, group => named, >> notify => Service[ "named::server ] >> } >> >> >> service { "named::server" : >> name => $operatingsystem ? { >> centos => "named", >> ubuntu => "bind9", >> solaris => "named". >> }. >> enable => true, >> ensure => running, >> } >> >> -- >> -ls >> >> -- >> 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<puppet-users%2Bunsubscribe@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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- -ls -- 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.