You must do one of two things to make this work.
You can either add a subscribe in the service definition for the
puppet.conf or you can put a notifiy in the puppet.conf file
definition for the puppet service.
example 1:
service {"puppet":
ensure => running,
enable => true,
subscribe => File["etc/puppet/puppet.conf"],
}
example 2:
file {"/etc/puppet/puppet.conf":
owner => root,
group => root,
mode => 644,
source => "puppet:/files/lserver/puppet.conf",
notify => Service["puppet"],
}
Just because you define these things in the same class does not mean
you have defined any relationships between the definitions in the
class. There's really no way for puppet to "figure out" that the file
definition is related to the service definition unless you tell it
they are related through one of the above methods.
On Feb 18, 6:03 pm, "David Dyer-Bennet" <[email protected]> wrote:
> I have a very simple-minded puppet.pp class, displayed in full at the bottom.
>
> When I update the file source of the puppet.conf file, the file gets
> distributed to the slave systems, but the service does not then get
> restarted. The doc says the service gets restarted whenever it receives "
> an event"; isn't updating a file in the class an event?
>
> I manually restarted the puppet service on one of the clients, and then
> the new config file immediately took effect.
>
> So what am I overlooking?
>
> (By the way, the lock file issue I asked about previously seems to have
> cleared itself up with a couple of restarts; that is, it went away while I
> was thrashing on other things.)
>
> Here's the puppet class, as promised:
>
> # $Id: puppet.pp 549 2008-11-26 16:30:47Z David.Dyer-Bennet $
>
> # This is amusingly, or perhaps recursively, warped. We want to
> # deploy a stock puppet config, so that the server name gets
> # distributed during bootstrapping.
>
> class puppet {
> file { "/etc/puppet/puppet.conf":
> owner => root,
> group => root,
> mode => 644,
> source => "puppet:/files/lserver/puppet.conf"
> }
> file { "/etc/puppet/namespaceauth.conf":
> owner => root,
> group => root,
> mode => 644,
> source => "puppet:/files/lserver/namespaceauth.conf"
> }
> package { "puppet":
> ensure => latest,
> }
> service { "puppet":
> ensure => running,
> enable => true,
> }
>
> }
>
> --
> David Dyer-Bennet, [email protected];http://dd-b.net/
> Snapshots:http://dd-b.net/dd-b/SnapshotAlbum/data/
> Photos:http://dd-b.net/photography/gallery/
> Dragaera:http://dragaera.info
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---