- From: Sean OMeara <
>
- To:
- Subject: [chef] Re: Installing large numbers of packages
- Date: Tue, 13 Sep 2011 23:41:45 -0400
If you'd like to be less verbose, you can take advantage of the fact
that you don't have to specify a resource's default action, which in
the case of package, is :install.
package "foo"
package "bar"
package "bazz"
package "buzz"
package "bizz"
package "bim"
package "bam"
package "bop"
-s
On Wed, Aug 31, 2011 at 7:53 PM, Matt Palmer
<
>
wrote:
>
I'm getting my first chef recipe in order, a simple one to prep a
>
workstation -- which is mostly "install this giant list of packages".
>
>
I was surprised to find that the simple, obvious way to do this:
>
>
package %w{foo bar baz} do
>
action :install
>
end
>
>
Didn't work. Resources don't accept an array as the namevar to do the
>
obvious thing. Instead, I've got to do either:
>
>
package "foo" do
>
action :install
>
end
>
>
package "bar" do
>
action :install
>
end
>
>
package "baz" do
>
action :install
>
end
>
>
Which is ridiculously verbose, or else:
>
>
%w{foo bar baz}.each do |pkg|
>
package pkg do
>
action :install
>
end
>
end
>
>
Which doesn't do anything for my "but you don't need to learn *much*
>
Ruby" claims to the rest of the team, and still isn't as compact and
>
clean as it could be.
>
>
Am I missing something obvious, or is one of the above options really
>
the recommended way to create big lists of resources?
>
>
Thanks,
>
- Matt
>
- [chef] Re: Installing large numbers of packages, Sean OMeara, 09/13/2011
Archive powered by MHonArc 2.6.16.