7

In my Puppet-manifest I need to exec a command, but only after an array-driven collection of another exec finished. Like this (pseudo-code):

  define foo() {
    exec { "touch $name": }
  }

....
  {
    $bars = [ "a", "b", "c" ]
    foo { $bars : }
    exec { "echo Done" :
        require => [ Foo["a"], Foo["b"], Foo["c"] ]
    }
  }

How do I implement the same dependency as given above without repeating each element of list $bars by hand?

8

Ok, never mind... The same array of arguments can be used, apparently:

$bars = [ "a", "b", "c" ]
foo { $bars : }
exec { "echo Done" :
    require => [ Foo[$bars] ]
}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.