Make puppet agent restart itself

Posted by SamKrieg on Server Fault See other posts from Server Fault or by SamKrieg
Published on 2012-08-31T12:29:35Z Indexed on 2012/09/22 21:40 UTC
Read the original article Hit count: 302

Filed under:
|

I've got a file that notifies the puppet agent.

In the network module, the proxy settings are included in the .gemrc file like this:

file { "/root/.gemrc":
  content => "http_proxy: $http_proxy\n",
  notify => Service['puppet'],
}

The problem is that puppet stops and does not restart.

Aug 31 12:05:13 snch7log01 puppet-agent[1117]: (/Stage[main]/Network/File[/root/.gemrc]/content) content changed '{md5}2b00042f7481c7b056c4b410d28f33cf' to '{md5}60b725f10c9c85c70d97880dfe8191b3'
Aug 31 12:05:13 snch7log01 puppet-agent[1117]: Caught TERM; calling stop

I assume the code does something like /etc/init.d/puppet stop && /etc/init.d/puppet start Since puppet is not running, it cannot start itself... it kind of makes sense.

How to make puppet restart itself when this file changes? Note that this file may not exist as well.

© Server Fault or respective owner

Related posts about linux

Related posts about puppet