mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-09 19:30:18 +01:00
Merge pull request #113 from geerlingguy/update-haproxy-rolling-update
Update HAProxy rolling_update.yml example - use haproxy module.
This commit is contained in:
commit
6a57cb8982
1 changed files with 7 additions and 7 deletions
|
@ -18,12 +18,12 @@
|
|||
# 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={{ inventory_hostname }} services=webserver
|
||||
nagios: 'action=disable_alerts host={{ inventory_hostname }} services=webserver'
|
||||
delegate_to: "{{ item }}"
|
||||
with_items: groups.monitoring
|
||||
|
||||
- name: disable the server in haproxy
|
||||
shell: echo "disable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
|
||||
haproxy: 'state=disabled backend=myapplb host={{ inventory_hostname }} socket=/var/lib/haproxy/stats'
|
||||
delegate_to: "{{ item }}"
|
||||
with_items: groups.lbservers
|
||||
|
||||
|
@ -34,15 +34,15 @@
|
|||
|
||||
# These tasks run after the roles:
|
||||
post_tasks:
|
||||
- name: Wait for webserver to come up
|
||||
wait_for: host={{ inventory_hostname }} port=80 state=started timeout=80
|
||||
- name: wait for webserver to come up
|
||||
wait_for: 'host={{ inventory_hostname }} port=80 state=started timeout=80'
|
||||
|
||||
- name: Enable the server in haproxy
|
||||
shell: echo "enable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
|
||||
- name: enable the server in haproxy
|
||||
haproxy: 'state=enabled backend=myapplb host={{ inventory_hostname }} socket=/var/lib/haproxy/stats'
|
||||
delegate_to: "{{ item }}"
|
||||
with_items: groups.lbservers
|
||||
|
||||
- name: re-enable nagios alerts
|
||||
nagios: action=enable_alerts host={{ inventory_hostname }} services=webserver
|
||||
nagios: 'action=enable_alerts host={{ inventory_hostname }} services=webserver'
|
||||
delegate_to: "{{ item }}"
|
||||
with_items: groups.monitoring
|
||||
|
|
Loading…
Reference in a new issue