|
|
|
@ -18,14 +18,14 @@ |
|
|
|
|
# These are the tasks to run before applying updates: |
|
|
|
|
pre_tasks: |
|
|
|
|
- name: disable nagios alerts for this host webserver service |
|
|
|
|
nagios: action=disable_alerts host=$ansible_hostname services=webserver |
|
|
|
|
delegate_to: $item |
|
|
|
|
with_items: ${groups.monitoring} |
|
|
|
|
nagios: action=disable_alerts host={{ ansible_hostname }} services=webserver |
|
|
|
|
delegate_to: "{{ item }}" |
|
|
|
|
with_items: groups.monitoring |
|
|
|
|
|
|
|
|
|
- name: disable the server in haproxy |
|
|
|
|
shell: echo "disable server myapplb/${ansible_hostname}" | socat stdio /var/lib/haproxy/stats |
|
|
|
|
delegate_to: $item |
|
|
|
|
with_items: ${groups.lbservers} |
|
|
|
|
shell: echo "disable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats |
|
|
|
|
delegate_to: "{{ item }}" |
|
|
|
|
with_items: groups.lbservers |
|
|
|
|
|
|
|
|
|
roles: |
|
|
|
|
- common |
|
|
|
@ -35,11 +35,11 @@ |
|
|
|
|
# These tasks run after the roles: |
|
|
|
|
post_tasks: |
|
|
|
|
- name: Enable the server in haproxy |
|
|
|
|
shell: echo "enable server myapplb/${ansible_hostname}" | socat stdio /var/lib/haproxy/stats |
|
|
|
|
delegate_to: $item |
|
|
|
|
with_items: ${groups.lbservers} |
|
|
|
|
shell: echo "enable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats |
|
|
|
|
delegate_to: "{{ item }}" |
|
|
|
|
with_items: groups.lbservers |
|
|
|
|
|
|
|
|
|
- name: re-enable nagios alerts |
|
|
|
|
nagios: action=enable_alerts host=$ansible_hostname services=webserver |
|
|
|
|
delegate_to: $item |
|
|
|
|
with_items: ${groups.monitoring} |
|
|
|
|
nagios: action=enable_alerts host={{ ansible_hostname }} services=webserver |
|
|
|
|
delegate_to: "{{ item }}" |
|
|
|
|
with_items: groups.monitoring |
|
|
|
|