kolla-ansible/ansible/roles/nova/tasks/simple_cell_setup.yml
Jeffrey Zhang af2acb25e5 Do not failed when there is no nova-compute is running
In ironic environment deployment, the compute nodes info will be empty
until ironic node is created. There are also some case that user just
want deploy without any nova-compute.

Also enable auto discover hosts feature. This is useful for small
environment.

Closes-Bug: #1666031
Change-Id: I6f3d1c3668452a404875aa5621ee99b2b41e28f0
2017-02-20 01:11:03 +08:00

34 lines
1.1 KiB
YAML

---
- name: Waiting for nova-compute service up
command: >
docker exec kolla_toolbox openstack
--os-auth-url {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}/v3
--os-identity-api-version 3
--os-project-domain-name default
--os-tenant-name admin
--os-username admin
--os-password {{ keystone_admin_password }}
--os-user-domain-name default
compute service list -f json --service nova-compute
register: nova_compute_services
changed_when: false
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"
retries: 20
delay: 10
until:
- nova_compute_services | success
- nova_compute_services.stdout | from_json | length != 0
- name: Running nova simple cell setup
command: docker exec nova_api nova-manage cell_v2 simple_cell_setup
register: cell_setup
changed_when:
- cell_setup | success
- '"Cell0 is already setup" not in cell_setup.stdout'
failed_when:
- cell_setup.rc != 0
- '"No hosts found to map to cell, exiting." not in cell_setup.stdout'
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"