it seems there is a bug in puppet --graph, that misses some dependencies.
https://tickets.puppetlabs.com/browse/PUP-2075

so, this code actually works as expected:

class { c3: }

class c1 {
  exec { exec1: command => '/bin/echo exec1; exit 1' }
}

class c2 {
*  # include c1*
*  contain c1*
  exec { exec2: command => '/bin/echo exec2' }
}

class c3 {
  class { c2: }
  ->
  exec { exec3: command => '/bin/echo exec3; exit 1' }
}

puppet does not execute exec3 because exec1 failed (thanks to replacing include 
c1 by contain c1).

$ puppet apply test.pp Notice: /Stage[main]/C1/Exec[exec1]/returns: exec1
Error: /bin/echo exec1; exit 1 returned 1 instead of one of [0]
Error: /Stage[main]/C1/Exec[exec1]/returns: change from notrun to 0 failed: 
/bin/echo exec1; exit 1 returned 1 instead of one of [0]
Notice: /Stage[main]/C2/Exec[exec2]/returns: executed successfully
Notice: /Stage[main]/C3/Exec[exec3]: Dependency Exec[exec1] has failures: 
true
Warning: /Stage[main]/C3/Exec[exec3]: Skipping because of failed 
dependencies

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5f9bb9b3-403e-4e53-9ffb-3bbcee794ce0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to