Undef
Puppet's undef
value is roughly equivalent
to nil
in Ruby. It represents the absence of a value. If
the strict_variables
setting isn’t enabled, variables which have never been
declared have a value of undef
.
The undef
value is useful for testing
whether a variable has been set. Also, you can use it to un-set resource attributes
that have inherited values from a resource
default, causing the attribute to be unmanaged.
The only value in the Undef
data type is the bare word undef
.
Conversion
When used as a boolean, undef
is false.
When interpolated into a string, undef
is
converted to the empty string.
The Undef
data type
The data type of undef
is Undef
. It matches
only the value undef
, and takes no parameters.
undef
value:-
The
Data
type matchesundef
in addition to several other data types. -
The
Any
type matches any value, includingundef
. -
The
Optional
type wraps one other data type, and returns a type that matchesundef
in addition to that type. -
The
Variant
type can accept theUndef
type as a parameter, which makes the resulting data type matchundef
. -
The
NotUndef
type matches any value exceptundef
.