Puppet:是否有方法捕获应用资源的失败?

Puppet:是否有方法捕获应用资源的失败?,puppet,Puppet,Puppet中是否有方法在应用资源时捕获失败,例如,当声明 file { '/var/tmp/test': ensure => file, mode => '0755', } 失败,调用类似 exec { 'Register some failure': command => '/var/tmp/register failure for /var/tmp/test', } ?您可以尝试以下方法: exec { 'Notify

Puppet中是否有方法在应用资源时捕获失败,例如,当声明

 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"],
  }

它不起作用-
../Exec[通知失败]:由于依赖项失败而跳过
您必须定义捕获失败的含义。。。如果puppet未能执行,是否要更正并强制执行创建
/var/tmp/test
文件?在这种情况下,您可能只想编写一个exec!