Merge "Add external LB management handler hook interface"
This commit is contained in:
commit
5061f61fd6
@ -31,6 +31,19 @@ Example playbook
|
|||||||
.. literalinclude:: ../../examples/playbook.yml
|
.. literalinclude:: ../../examples/playbook.yml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
|
External Restart Hooks
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
When the role performs a restart of the service, it will notify an Ansible
|
||||||
|
handler named ``Manage LB``, which is a noop within this role. In the
|
||||||
|
playbook, other roles may be loaded before and after this role which will
|
||||||
|
implement Ansible handler listeners for ``Manage LB``, allowing external roles
|
||||||
|
to manage the load balancer endpoints responsible for sending traffic to the
|
||||||
|
servers being restarted by marking them in maintenance or active mode,
|
||||||
|
draining sessions, etc. For an example implementation, please reference the
|
||||||
|
`ansible-haproxy-endpoints role <https://github.com/Logan2211/ansible-haproxy-endpoints>`_
|
||||||
|
used by the openstack-ansible project.
|
||||||
|
|
||||||
Tags
|
Tags
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -74,3 +74,7 @@
|
|||||||
- "'nova_compute' in group_names"
|
- "'nova_compute' in group_names"
|
||||||
- "nova_discover_hosts_in_cells_interval | int < 1"
|
- "nova_discover_hosts_in_cells_interval | int < 1"
|
||||||
listen: "Restart nova services"
|
listen: "Restart nova services"
|
||||||
|
|
||||||
|
- meta: noop
|
||||||
|
listen: Manage LB
|
||||||
|
when: false
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- { content: "{{ nova_console_user_ssl_combined.stdout ~ '\n' }}", dest: "{{ nova_console_ssl_cert }}", mode: "0644" }
|
- { content: "{{ nova_console_user_ssl_combined.stdout ~ '\n' }}", dest: "{{ nova_console_ssl_cert }}", mode: "0644" }
|
||||||
- { src: "{{ nova_console_user_ssl_key }}", dest: "{{ nova_console_ssl_key }}", mode: "0640" }
|
- { src: "{{ nova_console_user_ssl_key }}", dest: "{{ nova_console_ssl_key }}", mode: "0640" }
|
||||||
notify: Restart nova services
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart nova services
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
group: "root"
|
group: "root"
|
||||||
with_items: "{{ filtered_nova_services }}"
|
with_items: "{{ filtered_nova_services }}"
|
||||||
notify:
|
notify:
|
||||||
|
- Manage LB
|
||||||
- Restart nova services
|
- Restart nova services
|
||||||
|
|
||||||
- name: Place the systemd init script
|
- name: Place the systemd init script
|
||||||
@ -62,4 +63,5 @@
|
|||||||
config_type: "ini"
|
config_type: "ini"
|
||||||
with_items: "{{ filtered_nova_services }}"
|
with_items: "{{ filtered_nova_services }}"
|
||||||
notify:
|
notify:
|
||||||
|
- Manage LB
|
||||||
- Restart nova services
|
- Restart nova services
|
||||||
|
@ -120,7 +120,9 @@
|
|||||||
copy: "no"
|
copy: "no"
|
||||||
when:
|
when:
|
||||||
- nova_get_venv | changed
|
- nova_get_venv | changed
|
||||||
notify: Restart nova services
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart nova services
|
||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
@ -140,7 +142,9 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
when:
|
when:
|
||||||
- nova_get_venv | failed or nova_get_venv | skipped
|
- nova_get_venv | failed or nova_get_venv | skipped
|
||||||
notify: Restart nova services
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart nova services
|
||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
|
@ -51,7 +51,9 @@
|
|||||||
dest: "/etc/nova/policy.json-{{ nova_venv_tag }}"
|
dest: "/etc/nova/policy.json-{{ nova_venv_tag }}"
|
||||||
config_overrides: "{{ nova_policy_overrides }}"
|
config_overrides: "{{ nova_policy_overrides }}"
|
||||||
config_type: "json"
|
config_type: "json"
|
||||||
notify: Restart nova services
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart nova services
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
- nova-post-install
|
- nova-post-install
|
||||||
@ -64,7 +66,9 @@
|
|||||||
group: "root"
|
group: "root"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- rootwrap.d/*
|
- rootwrap.d/*
|
||||||
notify: Restart nova services
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart nova services
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
- nova-post-install
|
- nova-post-install
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
with_items: "{{ filtered_nova_services }}"
|
with_items: "{{ filtered_nova_services }}"
|
||||||
when: item.wsgi_app | default(False)
|
when: item.wsgi_app | default(False)
|
||||||
notify:
|
notify:
|
||||||
|
- Manage LB
|
||||||
- Restart nova services
|
- Restart nova services
|
||||||
|
|
||||||
# Cleanup and restart nginx configuration
|
# Cleanup and restart nginx configuration
|
||||||
|
Loading…
Reference in New Issue
Block a user