October 2011
Intermediate to advanced
300 pages
5h 51m
English
It's one darned thing after another! Arrays are a powerful feature in Puppet; wherever you want to perform the same operation on a list of things, an array may able to help. You can create an array just by putting its contents in square brackets:
$lunch = [ "franks", "beans", "mustard" ]
Add the following code to your manifest:
$packages = [ "ruby1.8-dev",
"ruby1.8",
"ri1.8",
"rdoc1.8",
"irb1.8",
"libreadline-ruby1.8",
"libruby1.8",
"libopenssl-ruby" ]
package { $packages: ensure => installed }Run Puppet, and note that each package should now be installed.
Where Puppet encounters an array as the name of a resource, it creates a resource for each element in the array. In the preceding example, ...
Read now
Unlock full access