Skip to content

Instantly share code, notes, and snippets.

@supercow
Created September 10, 2015 13:20
Show Gist options
  • Save supercow/298ca2df4a4a664d5122 to your computer and use it in GitHub Desktop.
Save supercow/298ca2df4a4a664d5122 to your computer and use it in GitHub Desktop.
class fail {
exec { 'fail':
command => '/bin/false',
}
}
include fail
$hash = { 'a' => { 'message' => 'a'} }
create_resources('notify',$hash,{'require' => 'Class[fail]'})
$ puppet apply /tmp/test.pp
Notice: Compiled catalog for ipa.4c in environment production in 0.55 seconds
Error: /bin/false returned 1 instead of one of [0]
Error: /Stage[main]/Fail/Exec[fail]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0]
Notice: /Stage[main]/Main/Notify[a]: Dependency Exec[fail] has failures: true
Warning: /Stage[main]/Main/Notify[a]: Skipping because of failed dependencies
Notice: Applied catalog in 0.08 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment