3
- Substituting variables or expressions '{{ <expression> }}'
6
"{{ (variable1 | int) + (variable2 | int) }}"
7
Also can be part of the longer strings:
8
"/dev/sda{{ (variable1 | int) + (variable2 | int) }}"
10
- Accessing various variables
11
{{ lookup('env','HOME') }} - shell environment
12
{{ hostvars[groups['webservers'][0]] }} - hosts in the groups defined in inventory (this will reference to the root of all gathered facts)
15
{{ ansible_lvm['lvs'][<var_holding_lv>]['vg'] }}
17
- A complete J2 templates files can be substantiated and installed in specified locations using the 'template' module
18
template: src="path/to/template.j2" dst="/path/destination/file" owner="root" group="root' mode="0755"