[Puppet Users] Exec depends on ressources that are several different types

Patrick Viet
2012-01-10T01:23:20Z

Hi dear puppet users.

I have an perl file that depends on a lib, that I want to execute.
I have stripped the parts of config that weren''t relevant here such as
owner, group and so on

In perl script : use Config::Tiny.
Script is stored on puppet master.

Manifest :
____
file { "/path/to/file.pl": source => "puppet:///file.pl, mode
=>
"0755" }
package { "libconfig-tiny-perl": ensure => installed }
exec { "/path/to/file.pl": require => XXXXXXXX }
____

at XXXXXX I would like to put Package[''libconfig-tiny-perl"] AND
File["/path/to/file.pl"] which doesn''t work.

In the docs
( http://docs.puppetlabs.com/guides/language_guide.html )
it gives an example
service { ''sshd'':
      require => File[''sshdconfig'',
''sshconfig'', ''authorized_keys'']
    }

But this only works for multiple dependencies that have the same
nature, here "File"

I have found a workaround which is to put the package dependency in
the file section (file depends on package, exec depends on file, all
solved), but while this does work in my specific case, I''m sure there
are others where it wouldn''t work.

So is there any way to specify multiple resource dependency when the
resources have a different nature ?

Thanks all

Patrick