471985dc2c
With the more recent versions of ansible, we should now use "is" instead of the "|" This should update it. Change-Id: I6fba56fca182349972e8b0ee5452b37aa4090e0c
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
---
|
|
- name: Create cell0 mappings
|
|
command: >
|
|
docker exec nova_api nova-manage cell_v2 map_cell0
|
|
register: map_cell0
|
|
changed_when:
|
|
- map_cell0 is 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_tasks: 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 is 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 {{ openstack_auth.domain_name }}
|
|
--os-tenant-name {{ openstack_auth.project_name }}
|
|
--os-username {{ openstack_auth.username }}
|
|
--os-password {{ keystone_admin_password }}
|
|
--os-user-domain-name {{ openstack_auth.domain_name }}
|
|
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 is success
|
|
- nova_compute_services.stdout | from_json | length != 0
|
|
|
|
- name: Discovering nova hosts
|
|
command: >
|
|
docker exec nova_api nova-manage cell_v2 discover_hosts --by-service
|
|
register: discover_hosts
|
|
changed_when: False
|
|
run_once: True
|
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
|
|
|
- name: Refresh cell cache in nova scheduler
|
|
command: docker kill --signal HUP nova_scheduler
|
|
changed_when: False
|
|
when:
|
|
- inventory_hostname in groups['nova-scheduler']
|