how to restart the server (like weblogic , tomacat )by puppet ?
How to restart the server (like weblogic , tomacat )by puppet script?
Notify the service:
service { 'service_that_should_be_restarted':
...
}
resource_that_will_trigger_service_restart { 'name':
...
notify => Service['service_that_should_be_restarted'],
}
Alternatively, you can have the service subscribed to another resource:
service { 'service_that_should_be_restarted':
...
subscribe => Resource_that_will_trigger_service_restart['name'],
}
resource_that_will_trigger_service_restart { 'name':
...
}
Pls check:
https://docs.puppet.com/puppet/4.5/re...
https://docs.puppet.com/puppet/4.5/re...
https://docs.puppet.com/puppet/4.5/re...
When do you want it to restart? If it's any time puppet is run, you can run another command like the one in your previous post:
exec { 'restart-command':
command => 'service tomcat restart',
path => '/usr/bin/service',
}
Asked: 2016-06-27 20:10:05 -0500
Seen: 65 times
Last updated: Jul 02 '16