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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -