Patrick Viet
2012-Jan-10 01:23 UTC
[Puppet Users] Exec depends on ressources that are several different types
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 -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Aaron Grewell
2012-Jan-10 22:07 UTC
Re: [Puppet Users] Exec depends on ressources that are several different types
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.viet@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 => 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 > > -- > 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+unsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Patrick Viet
2012-Jan-16 00:17 UTC
[Puppet Users] Re: Exec depends on ressources that are several different types
On Jan 11, 9:07 am, Aaron Grewell <aaron.grew...@gmail.com> wrote:> require accepts an array, so you should be able to do this: > require => [File[''foo''],Exec[''bar'']]It worked. Thanks so much. I should submit this as an addition in one of the wiki examples on the puppet website. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nigel Kersten
2012-Jan-16 00:49 UTC
Re: [Puppet Users] Re: Exec depends on ressources that are several different types
On Sun, Jan 15, 2012 at 4:17 PM, Patrick Viet <patrick.viet@learnosity.com>wrote:> On Jan 11, 9:07 am, Aaron Grewell <aaron.grew...@gmail.com> wrote: > > require accepts an array, so you should be able to do this: > > require => [File[''foo''],Exec[''bar'']] > > It worked. Thanks so much. I should submit this as an addition in one > of the wiki examples on the puppet website. > >Ideally submit it as a bug against this page: http://docs.puppetlabs.com/guides/language_guide.html here: http://projects.puppetlabs.com/projects/puppet-docs/issues/new -- Nigel Kersten Product Manager, Puppet Labs -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.