Merge "Add external LB management handler hook interface"

This commit is contained in:
Jenkins 2017-09-20 07:20:55 +00:00 committed by Gerrit Code Review
commit 5061f61fd6
7 changed files with 35 additions and 5 deletions

View File

@ -31,6 +31,19 @@ Example playbook
.. literalinclude:: ../../examples/playbook.yml
: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
~~~~

View File

@ -74,3 +74,7 @@
- "'nova_compute' in group_names"
- "nova_discover_hosts_in_cells_interval | int < 1"
listen: "Restart nova services"
- meta: noop
listen: Manage LB
when: false

View File

@ -39,6 +39,8 @@
with_items:
- { 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" }
notify: Restart nova services
notify:
- Manage LB
- Restart nova services
tags:
- nova-config

View File

@ -49,6 +49,7 @@
group: "root"
with_items: "{{ filtered_nova_services }}"
notify:
- Manage LB
- Restart nova services
- name: Place the systemd init script
@ -62,4 +63,5 @@
config_type: "ini"
with_items: "{{ filtered_nova_services }}"
notify:
- Manage LB
- Restart nova services

View File

@ -120,7 +120,9 @@
copy: "no"
when:
- nova_get_venv | changed
notify: Restart nova services
notify:
- Manage LB
- Restart nova services
tags:
- nova-pip-packages
@ -140,7 +142,9 @@
delay: 2
when:
- nova_get_venv | failed or nova_get_venv | skipped
notify: Restart nova services
notify:
- Manage LB
- Restart nova services
tags:
- nova-pip-packages

View File

@ -51,7 +51,9 @@
dest: "/etc/nova/policy.json-{{ nova_venv_tag }}"
config_overrides: "{{ nova_policy_overrides }}"
config_type: "json"
notify: Restart nova services
notify:
- Manage LB
- Restart nova services
tags:
- nova-config
- nova-post-install
@ -64,7 +66,9 @@
group: "root"
with_fileglob:
- rootwrap.d/*
notify: Restart nova services
notify:
- Manage LB
- Restart nova services
tags:
- nova-config
- nova-post-install

View File

@ -30,6 +30,7 @@
with_items: "{{ filtered_nova_services }}"
when: item.wsgi_app | default(False)
notify:
- Manage LB
- Restart nova services
# Cleanup and restart nginx configuration