The variables
Synopsis
- variable
- variables
A variable is an abstract black box (container) paired with an associated symbolic name, which contains some defined or undefined quantity of data referred to as a
value.
This definition, makes a heavy use of data typing. Indeed, depending on the type system definition of the constistency handling system used, variables may only be able to store a specified data type. OK, variables are the containers for storing the values. It has something to do with typing. But this is not just about typing.
Name
Variable’s associated symbolic name.
It’s best to follow the convention on variable names.
Parameters
Parameter |
Comments |
|---|---|
help
|
Additional help associated with the variable. |
default |
Default value(s) of the variable. This value is typed, you must correctly fill out the YAML file to avoid defining a value with an incorrect type. For example, a For a non leading multiple variable, the first value defined in the list will also be the default value proposed if a new value is added to this variable. |
validators
|
Value validators. Jinja template list. The value of the variable will be considered invalid if the template has a return value. |
auto_save
|
Variable with automatically modified value. A variable with automatically modified value is a variable whose value will be considered as modified (that is, it is no longer the variable’s default value). For example, if the value of this variable comes from a calculation, the value will no longer be recalculated. These variables are usually required variables. In fact, these variables are only automatically modified if they have a value. A leader or follower variable cannot have the Default value: |
mode
|
Variable’s mode. Default value: The Special cases :
|
multi
|
The value of the variable is a list. Default value: |
unique
|
The multiple type variable accepts the same value several times. If unique is set to Default value: |
hidden
|
Invisible variable. Enables us to hide a variable. This means that the variable will no longer be visible in When a variable is made invisible, the user will not be able to modify its value; if he has already succeeded in modifying it, this value will not be taken into account. Default value: |
disabled
|
Disabled variable. Allows us to deactivate a variable. This means that the variable will no longer be visible to the user but also to a calculation. Default value: |
mandatory
|
Mandatory variable. Variable whose value is For a multiple variable, this means that the list shall not be empty. Default value: |
redefine
|
It is possible to define a variable in one dictionary and change its behavior in a second dictionary. In this case you must explicitly redefine the variable. Default value: |
exists
|
This attribute does two things:
Default value: |
test
|
The Concretely, the content of this attribute is recorded in the |
Variables types
A variable has a type.
This type enables the variable to define the values that are accepted by this variable.
Value |
Comments |
Parameters |
Samples |
|---|---|---|---|
string |
character string (default type) |
test “1” “true” |
|
number |
a number |
|
1 |
float |
a floating number |
1.2 |
|
boolean |
A boolean, if no value is defined the default value of this variable will be |
|
|
secret |
a secret (like a password, a private key, etc.) |
|
|
a mail address |
|||
unix_filename |
a file name in the Unix meaning |
|
|
date |
a date in the format |
|
|
unix_user |
a user in the Unix meaning |
test |
|
ip |
any kind of IPv4 address |
|
|
cidr |
any IPv4 address in the CIDR format |
|
|
netmask |
mask of an IPv4 address |
|
|
network |
network address |
|
|
network_cidr |
network address in CIDR format |
|
|
broadcast |
broadcast address |
|
|
netbios |
netbios name |
machine |
|
domainname |
domain name |
|
|
hostname |
host name |
|
machine |
web_address |
web address |
|
|
port |
port |
|
8080 |
mac |
MAC address |
11:11:11:11:11:11 |
|
unix_permissions |
access rights to the file, directory, etc. |
644 |
|
choice |
choice variable |