Merge "Wait for nova-compute service registration"

This commit is contained in:
Jenkins 2017-02-09 17:37:37 +00:00 committed by Gerrit Code Review
commit 0590b985c6
4 changed files with 34 additions and 0 deletions

View File

@ -460,6 +460,7 @@ nova_requires_pip_packages:
- virtualenv-tools
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- httplib2
- python-openstackclient
nova_compute_pip_packages:
- libvirt-python

View File

@ -23,6 +23,7 @@
name: "{{ item.value.service_name }}"
state: "restarted"
with_dict: "{{ nova_services }}"
register: nova_service_restart
when:
- inventory_hostname in groups[item.value.group]
- "{{ item.value.condition | default(true) }}"

View File

@ -85,6 +85,13 @@
- name: Flush handlers
meta: flush_handlers
- include: nova_compute_wait.yml
when:
- "{{ 'nova_compute' in group_names }}"
- "{{ nova_service_restart | default(dict(changed=False)) | changed }}"
tags:
- nova-config
- include: nova_db_post_setup.yml
when: inventory_hostname == groups['nova_api_os_compute'][0]
tags:

View File

@ -0,0 +1,25 @@
---
# Copyright 2017, Logan Vig <logan2211@gmail.com>
#
# 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: Wait for the nova-compute service to initialize
command: openstack --os-cloud default compute service list -f json
changed_when: false
register: nova_service_list
retries: 10
delay: 5
until: "{{ ansible_hostname in (nova_service_list.stdout
| from_json
| selectattr('Binary', 'equalto', 'nova-compute')
| map(attribute='Host') | list) }}"