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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

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

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -