Is there anyway to send a trigger to Puppet to perform a series to tasks ?
The application is served by Apache httpd. Every once in a while developers make changes to the product which in turn requires us to restart Apache. However, I cannot figure out how to send a request to Puppet which in turn will restart Apache.
Basically, this is more of a asynchronous request compared to a "serial" or synchronous flow of Puppet run that executes every 30 minutes.
Any thoughts on this ?
Remember that puppet
is not a task manager. puppet
is a state manager.
httpd
; rather, it ensures that httpd
is running.The distinction is important.
That said ...
Is puppet
also managing the changes being made by the developers?
If so, then you should be able to create a puppet rule
exec { httpdrestart :
command => "/sbin/service httpd restart",
refreshonly => true,
}
and then attach to whatever puppet
rule is managing your developers' changes
file { '/var/www/html/mywebproject.html':
ensure => present,
source => 'puppet:///modules/mymodule/mywebproject.html',
notify => Exec["httpdrestart"]
}
that after this file is installed/updated/changed, httpd
needs to be restarted.
If you just expect puppet
to restart httpd simple because you asked it to, then you either need to use a program like ansible
which is more of an actual task manager, or use some kind of inotify
thing to see that a certain file has been changed, so httpd
must be restarted.
(caveat -- but I know nothing about inotify
beyond the name.)