-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Puppet 8 for DevOps Engineers
By :

This section will cover the two core collections of data in Puppet: arrays and hashes. You will learn how to create, access, and perform operations to manipulate the values into a new variable.
Puppet arrays are created by surrounding comma-separated lists of values with square brackets. An optional comma can be added after the last element, but this book recommends against that for styling. For example, an array called example_array
containing the first
, second
, and third
strings, and would be declared as follows:
$example_array = ['first','second','third']
Arrays can contain any data type, as well as a mix of data types. A Puppet variable cannot be reassigned in terms of individual values or in terms of any other manipulation such as the addition or removal of values. The following code shows how to assign the mixed_example_array
array with the integer of 1
, a Boolean value of false
from the example_boolean...