March 2019
Intermediate to advanced
412 pages
9h 49m
English
Variables that are passed along when listing a dependency will override values for matching variables defined in defaults/main.yaml or vars/main.yaml. This can be useful for using a common role, such as an apache role, as a dependency while providing site-specific data such as what ports to open in the firewall or what apache modules to enable. Variables are expressed as additional keys to the role listing. Thus, continuing our hypothetical example, consider that we need to pass some variables to both the common and apache role dependencies we discussed:
---
dependencies:
- role: common
simple_var_a: True
simple_var_b: False
- role: apache
complex_var:
key1: value1
key2: value2
short_list:
- 8080
- 8081
When providing ...
Read now
Unlock full access