Multiple puppet requires

Keynan picture Keynan · Mar 10, 2014 · Viewed 28.3k times · Source

Hi I'd like to make a puppet resource/task dependent on multiple other tasks.

For example:

file{'~/foo':}
file{'~/bar':}
file{'~/foobar':
  require => File['~foo'],
  require => File['~bar']
}

What's the correct syntax to define this?

Thanks

Answer

Raul Andres picture Raul Andres · Mar 10, 2014

From Language: Data Types

Resource attributes which can optionally accept multiple values (including the relationship metaparameters) expect those values in an array.

file{'~/foo':}
file{'~/bar':}
file{'~/foobar':
  require => [ File['~foo'], File['~bar'] ]
}