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.
You may need to add to the service resource declaration for 'puppet':
In addition to making sure that "hasrestart" is in the manifest, you should also make sure that
Is in the manifest. Here is my copy:
I had a similar problem. I needed to deploy fixes to augeas, and used puppet to deploy them, but they would not take effect until puppetd was restarted. So I needed a quick and easy way to tell puppetd to restart one time. I solved this with a shell script and an exec.
Here is the script:
The manifest to run the script makes use of the log file it creates. (This works fine for the first time - if you make subsequent updates, make a manifest that will delete the log file so this will run one time again):