Marc Gariepy fa3797d857 Enable Nginx for nova-placement
On CentOS the default is to have service disabled, this ensure nginx is enabled.

Closes-bug: 1681533
Change-Id: I98018fca9c277248b77b60081ea560c012b370af
2017-04-23 02:17:11 +00:00

87 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
enabled: yes
state: reloaded
register: nova_nginx_restart
until: nova_nginx_restart | success
retries: 5
delay: 2
when: inventory_hostname in groups['nova_api_placement']