Default variable details
Some of debops.environment default variables have more extensive
configuration than simple strings or lists, here you can find documentation and
examples for them.
environment__variables
The environment variable lists can use different formats of list entries.
Strings:
environment__variables:
- 'variable1=value1'
- 'variable2=value2'
- 'variable3=value3'
YAML dictionaries of variables:
environment__variables:
- variable1: 'value1'
variable2: 'value2'
variable3: 'value3'
YAML dictionaries of conditional variables - they are detected when name
and value keys are used in the same YAML dictionary:
environment__variables:
- name: 'variable1'
value: 'value1'
- name: 'variable2'
value: 'value2'
state: 'absent'
- name: 'variable3'
value: 'value3'
upper: True
When the conditional variables are detected, you can specify these parameters:
nameRequired. Name of the environment variable.
valueRequired. Value of the environment variable.
stateOptional. If not specified or
present, variable will be set in the/etc/environmentfile. Ifabsent, variable will not be included. The role does not remove already set variables in the/etc/environmentfile outside of the Ansible block.caseOptional. Change the case of the variable name, either
upperorlower. If not set, the current case will be preserved.
To set the name and value variables in the environment, you need to
specify them separately:
environment__variables:
- name: 'value1'
- value: 'value2'