I would like to get another host from one of my templates.
Given the following hosts
file:
[vm]
vm_hostname
[monitoring]
monitoring_hostname
How can I access monitoring_hostname
from a template?
I tried:
monitor: {{ hostvars['monitoring'][0] }}
NB: I can't just use monitor: monitoring_hostname
because my hosts
file is dynamically generated.