It's time to look at expressions in a little more detail, and see what kind of expressions Puppet allows us to construct.
An important kind of expression is the comparison expression. This compares two values, and the expression is true or false depending on the result of the comparison.
We've already seen an expression involving a comparison of two values:
$eggs == '61'
And we know the ==
operator means "is equal to." Its opposite is the != operator
(not equal to):
$username != 'FOTHERINGTON-THOMAS'
Comparison expressions like these are logical expressions; their value is either true or false. By the way, true
and false
are reserved words in
Puppet that stand for these logical values. You can use them like any other literal values:
$raining = true if $raining { include umbrella }