This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to VietTUG.org

Puppet: "Exec" dependency problem

weird
Added by ruby 11 months ago  »  Votes: 1/1

See the below code

1 file {
2 "foobar": ensure => "present",
3   notify => Exec["foobar-a", "foobar-b"],
4   require => Exec["foobar-b"];}
5 
6 exec {
7 "foobar-a": command => "/bin/true", require => Exec["foobar-b"] ;
8 "foobar-b": command => "/bin/false" ; }

Question: How are these recipes evaluated by Puppet?

Update 2012 July 18th:

  • Dependencies: Exec[foobar-b] --> Exec[foobar-a] --> File[foobar]
  • Exec[foobar-b] will be always executed. As it fails, other items are skipped
  • If Exec[foobar-b] changed to command => "/bin/true", the file foobar will be created if it is missing
  • If Exec[foobar-b] changed to command => "/bin/true", onlyif => "something", the this portion may be executed or not. Any both cases, it will be considered as successful, hence file foobar will be crated if it is missing
  • The the last two cases, if the contents of the file foobar changes, two @[email protected] will be evaluated

Comments