Logan V 5c99b10178 Ordered service restarts
Use specific ordering for nova service restarts.

Change-Id: I29e17c09c6aa1b626aead8e4916cc89604a371d6
2017-02-22 07:15:18 -06:00

82 lines
2.5 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"
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"
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"
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"
register: nova_compute_restart
when:
- "{{ nova_services['nova-compute']['group'] in group_names }}"
- "{{ nova_services['nova-compute']['condition'] | default(true) }}"
- name: Restart Nginx
systemd:
name: nginx
state: restarted
register: nova_nginx_restart
until: nova_nginx_restart | success
retries: 5
delay: 2
when: inventory_hostname in groups['nova_api_placement']