Le 12 mars 2013 à 12:24, Gergo Erdosi <ge...@timble.net> a écrit :

> Hi David,
> 
> Nice, didn't know I can use multiple packages inside Package. Thanks!
> 
> Gergo Erdosi
> 
> On Tue, Mar 12, 2013 at 12:19 PM, David Schmitt <da...@dasz.at> wrote:
>> On 12.03.2013 11:45, ge...@timble.net wrote:
>>> 
>>> Hi,
>>> 
>>> I have an Exec which requires a lot of packages (15-20):
>>> 
>>> Exec { 'name':
>>>   ...
>>>   require => [ Package['first'], Package['second'], Package['third'], ...
>>> ]
>>> }
>>> 
>>> Is there a way to shorten this list and make it easier to read?
>> 
>> 
>> You can use
>> 
>>  require => Package['first', 'second', 'third', ...]
>> 
>> instead.
>> 
>> Also, putting this into a variable and using that instead, may improve your
>> situation:
>> 
>>  $packages = ['first', 'second', 'third', ...]
>> 
>>  package { $packages: ensure installed }
>> 
>>  exec { "foo": require => Package[$packages] }
>> 
>> Best Regards, David


This works too :

package{'needed for exec':
  name => $packages,
  ensure => present,
}

exec { "foo": require => Package['needed for exec'] }

Less object, so a smaller catalog, and faster because your package tool is run 
once, not one time for each package.

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


Reply via email to