Puppet:有没有办法捕获应用资源失败? [英] Puppet: is there a way to catch failure to apply a resource?
本文介绍了Puppet:有没有办法捕获应用资源失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Puppet 中是否有一种方法可以在应用资源时捕获失败,例如,当声明像
is there a way in Puppet to catch a failure when resource is applied, for example, when declaration like
file { '/var/tmp/test':
ensure => file,
mode => '0755',
}
失败,调用类似
exec { 'Register some failure':
command => '/var/tmp/register failure for /var/tmp/test',
}
?
推荐答案
你可以试试这个:
exec { 'Notify a failure' :
command => "/var/tmp/register failure for /var/tmp/test",
path => "/bin:",
subscribe => File["/var/tmp/test"],
}
这篇关于Puppet:有没有办法捕获应用资源失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文