- From: Matt Palmer <
>
- To:
- Subject: [chef] Installing large numbers of packages
- Date: Thu, 1 Sep 2011 09:53:55 +1000
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] Installing large numbers of packages, Matt Palmer, 08/31/2011
Archive powered by MHonArc 2.6.16.