Ansible & Jinja2 - Set other host in jinja2 -
there master/slave setup.
goal:
set {{ other_host_of_play }}
in jinja2 template. example;
the content of node1
should contain node2
tried {{ play_hosts[0] }}
, sets first host of play, instead of 'other host'.
not sure if allowed this. answer in post @konstantinsuvorov provided.
{{ play_hosts | difference([inventory_hostname]) }}
Comments
Post a Comment