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

2012-01-10 Thread Patrick Viet
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 =  }


at XX 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

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



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

2012-01-10 Thread Aaron Grewell
require accepts an array, so you should be able to do this:
require = [File['foo'],Exec['bar']]

On Mon, Jan 9, 2012 at 5:23 PM, Patrick Viet
patrick.v...@learnosity.com wrote:
 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 =  }
 

 at XX 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

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.