Files
openstack-ansible-os_nova/handlers/main.yml
Dan Kolb 5fbbff6b46 Reload service files on Nova services restart
During an upgrade new service files are added, but systemd is not
reloaded during restart of nova services to pick up these file
changes. This performs a daemon-reload when restarting nova
services.

Change-Id: I98b3f66429ee045f052ad491847cf82d2f5d4efc
Closes-Bug: #1673889
2017-03-31 19:26:43 +00:00

86 lines
2.6 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Restart libvirt-bin
systemd:
name: "{{ libvirt_service_name }}"
state: "restarted"
daemon_reload: yes
- name: Restart nova services
command: /bin/true
notify:
- Restart nova conductor
- Restart nova API
- Restart nova misc services
- Restart nova compute
- name: Restart nova conductor
systemd:
name: "{{ nova_services['nova-conductor']['service_name'] }}"
state: "restarted"
daemon_reload: yes
register: nova_conductor_restart
when:
- "{{ nova_services['nova-conductor']['group'] in group_names }}"
- "{{ nova_services['nova-conductor']['condition'] | default(true) }}"
- name: Restart nova API
systemd:
name: "{{ nova_services['nova-api-os-compute']['service_name'] }}"
state: "restarted"
daemon_reload: yes
register: nova_api_restart
when:
- "{{ nova_services['nova-api-os-compute']['group'] in group_names }}"
- "{{ nova_services['nova-api-os-compute']['condition'] | default(true) }}"
# Used for services where restart ordering does not matter
- name: Restart nova misc services
systemd:
name: "{{ nova_services[item]['service_name'] }}"
state: "restarted"
daemon_reload: yes
register: nova_misc_restart
with_items:
- nova-api-metadata
- nova-consoleauth
- nova-novncproxy
- nova-scheduler
- nova-spicehtml5proxy
- nova-placement-api
when:
- "{{ nova_services[item]['group'] in group_names }}"
- "{{ nova_services[item]['condition'] | default(true) }}"
- name: Restart nova compute
systemd:
name: "{{ nova_services['nova-compute']['service_name'] }}"
state: "restarted"
daemon_reload: yes
register: nova_compute_restart
when:
- "{{ nova_services['nova-compute']['group'] in group_names }}"
- "{{ nova_services['nova-compute']['condition'] | default(true) }}"
- name: Reload Nginx
systemd:
name: nginx
state: reloaded
register: nova_nginx_restart
until: nova_nginx_restart | success
retries: 5
delay: 2
when: inventory_hostname in groups['nova_api_placement']