版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/83141784
exec { 'keep-nginx-running' :
user => 'root',
unless => 'ps -x | grep nginx|grep -v grep',
command => 'systemctl start nginx.service',
path => '/usr/bin:/usr/sbin:/sbin:/bin',
}