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]) }} 

how remove or exclude item in ansible template list?


Comments

Popular posts from this blog

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -