kolla-ansible/ansible/roles/nova/tasks/simple_cell_setup.yml
Eduardo Gonzalez 5dfb81efc8 Update simple_cell_setup to manual creation
Simple_cell_setup is not recomended to use.
Is better create map_cell0 manually, create base
cell for non cell deployments and run discover_hosts.

This PS migrate actual config to make use of described
workflow at [1]. We our actual workflow we're running
into the issue that services are not mapped until cells
are present, breaking deployment waiting for compute
services to appear.

[1] https://docs.openstack.org/developer/nova/cells.html#fresh-install

Change-Id: Id061e8039e72de77a04c51657705457193da2d0f
Closes-Bug: #1682060
2017-04-18 12:09:13 +01:00

58 lines
1.6 KiB
YAML

---
- name: Create cell0 mappings
command: >
docker exec nova_api nova-manage cell_v2 map_cell0
register: map_cell0
changed_when:
- map_cell0 | success
- '"Cell0 is already setup" not in map_cell0.stdout'
failed_when:
- map_cell0.rc != 0
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"
- include: bootstrap_service.yml
when: map_cell0.changed
- name: Create base cell for legacy instances
command: >
docker exec nova_api nova-manage cell_v2 create_cell
register: base_cell
changed_when:
- base_cell | success
failed_when:
- base_cell.rc != 0
- '"already exists" not in base_cell.stdout'
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"
- name: Waiting for nova-compute service up
command: >
docker exec kolla_toolbox openstack
--os-interface internal
--os-auth-url {{ keystone_admin_url }}
--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: Discovering nova hosts
command: >
docker exec nova_api nova-manage cell_v2 discover_hosts
register: discover_hosts
changed_when: False
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"