File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,5 @@ backend app
3535 {% endfor %}
3636 balance {{ balance }}
3737 {% for host in groups ['webservers' ] %}
38- server {{ hostvars[ host] .ansible_hostname }} {{ hostvars[host] ['ansible_' + iface] .ipv4.address }}:{{ httpd_port }}
38+ server {{ host }} {{ hostvars[host] ['ansible_' + iface] .ipv4.address }}:{{ httpd_port }}
3939 {% endfor %}
Original file line number Diff line number Diff line change 1818 # These are the tasks to run before applying updates:
1919 pre_tasks :
2020 - name : disable nagios alerts for this host webserver service
21- nagios : action=disable_alerts host={{ ansible_hostname }} services=webserver
21+ nagios : action=disable_alerts host={{ inventory_hostname }} services=webserver
2222 delegate_to : " {{ item }}"
2323 with_items : groups.monitoring
2424
2525 - name : disable the server in haproxy
26- shell : echo "disable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats
26+ shell : echo "disable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
2727 delegate_to : " {{ item }}"
2828 with_items : groups.lbservers
2929
3838 wait_for : host={{ inventory_hostname }} port=80 state=started timeout=80
3939
4040 - name : Enable the server in haproxy
41- shell : echo "enable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats
41+ shell : echo "enable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
4242 delegate_to : " {{ item }}"
4343 with_items : groups.lbservers
4444
4545 - name : re-enable nagios alerts
46- nagios : action=enable_alerts host={{ ansible_hostname }} services=webserver
46+ nagios : action=enable_alerts host={{ inventory_hostname }} services=webserver
4747 delegate_to : " {{ item }}"
4848 with_items : groups.monitoring
Original file line number Diff line number Diff line change 1111 - c
1212
1313 tasks :
14- - shell : echo hello {{ ansible_hostname.upper() }}
14+ - debug : msg=" hello {{ ansible_hostname.upper() }}"
1515
1616 - shell : echo match
1717 when : 2 == 2
1818
1919 - shell : echo no match
2020 when : 2 == 2 + 1
2121
22- - shell : echo {{ ansible_os_family }}
22+ - debug : msg=" {{ ansible_os_family }}"
2323
2424 - shell : echo {{ item }}
2525 with_items : a_list
You can’t perform that action at this time.
0 commit comments