March 2017
Beginner to intermediate
925 pages
18h 11m
English
Arrays are a powerful feature in Puppet; wherever you want to perform the same operation on a list of things, an array may be able to help. You can create an array just by putting its content in square brackets:
$lunch = [ 'franks', 'beans', 'mustard' ]
Here's a common example of how arrays are used:
$packages = [ 'ruby1.8-dev',
'ruby1.8',
'ri1.8',
'rdoc1.8',
'irb1.8',
'libreadline-ruby1.8',
'libruby1.8',
'libopenssl-ruby' ]
package { $packages: ensure => installed }Where Puppet encounters an array as the name of a resource, it creates a resource for each element in the array. In the example, ...
Read now
Unlock full access