Puppet:有没有办法捕获应用资源的失败?

时间:2014-03-04 13:45:06

标签: puppet

在Puppet中有一种方法可以在应用资源时捕获失败,例如,当声明像

 file { '/var/tmp/test':
      ensure => file,
      mode   => '0755',
    }

失败,调用类似

的内容
exec { 'Register some failure':
    command => '/var/tmp/register failure for /var/tmp/test',
}

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

  exec { 'Notify a failure' :
      command => "/var/tmp/register failure for /var/tmp/test",
      path => "/bin:",
      subscribe => File["/var/tmp/test"],
  }