File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,5 @@ backend app
35
35
{% endfor %}
36
36
balance {{ balance }}
37
37
{% 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 }}
39
39
{% endfor %}
Original file line number Diff line number Diff line change 18
18
# These are the tasks to run before applying updates:
19
19
pre_tasks :
20
20
- 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
22
22
delegate_to : " {{ item }}"
23
23
with_items : groups.monitoring
24
24
25
25
- 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
27
27
delegate_to : " {{ item }}"
28
28
with_items : groups.lbservers
29
29
38
38
wait_for : host={{ inventory_hostname }} port=80 state=started timeout=80
39
39
40
40
- 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
42
42
delegate_to : " {{ item }}"
43
43
with_items : groups.lbservers
44
44
45
45
- 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
47
47
delegate_to : " {{ item }}"
48
48
with_items : groups.monitoring
Original file line number Diff line number Diff line change 11
11
- c
12
12
13
13
tasks :
14
- - shell : echo hello {{ ansible_hostname.upper() }}
14
+ - debug : msg=" hello {{ ansible_hostname.upper() }}"
15
15
16
16
- shell : echo match
17
17
when : 2 == 2
18
18
19
19
- shell : echo no match
20
20
when : 2 == 2 + 1
21
21
22
- - shell : echo {{ ansible_os_family }}
22
+ - debug : msg=" {{ ansible_os_family }}"
23
23
24
24
- shell : echo {{ item }}
25
25
with_items : a_list
You can’t perform that action at this time.
0 commit comments