在Puppet中有一种方法可以在应用资源时捕获失败,例如,当声明像
时 file { '/var/tmp/test':
ensure => file,
mode => '0755',
}
失败,调用类似
的内容exec { 'Register some failure':
command => '/var/tmp/register failure for /var/tmp/test',
}
答案 0 :(得分:0)
你可以试试这个:
exec { 'Notify a failure' :
command => "/var/tmp/register failure for /var/tmp/test",
path => "/bin:",
subscribe => File["/var/tmp/test"],
}