Run nova-manage simple_cell_setup during deploying and upgrading
Change-Id: I64dd52d909a884b2b9aea6f016d789d99caa3f17 Closes-Bug: #1652580
This commit is contained in:
parent
700089f5b3
commit
68d3d8ba29
@ -13,6 +13,7 @@
|
|||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ nova_database_name }}"
|
- "{{ nova_database_name }}"
|
||||||
|
- "{{ nova_database_name }}_cell0"
|
||||||
- "{{ nova_api_database_name }}"
|
- "{{ nova_api_database_name }}"
|
||||||
|
|
||||||
- name: Creating Nova databases user and setting permissions
|
- name: Creating Nova databases user and setting permissions
|
||||||
@ -23,7 +24,7 @@
|
|||||||
login_port: "{{ database_port }}"
|
login_port: "{{ database_port }}"
|
||||||
login_user: "{{ database_user }}"
|
login_user: "{{ database_user }}"
|
||||||
login_password: "{{ database_password }}"
|
login_password: "{{ database_password }}"
|
||||||
name: "{{ item.database_name }}"
|
name: "{{ item.database_username }}"
|
||||||
password: "{{ item.database_password }}"
|
password: "{{ item.database_password }}"
|
||||||
host: "%"
|
host: "%"
|
||||||
priv: "{{ item.database_name }}.*:ALL"
|
priv: "{{ item.database_name }}.*:ALL"
|
||||||
@ -31,8 +32,13 @@
|
|||||||
register: database_user_create
|
register: database_user_create
|
||||||
with_items:
|
with_items:
|
||||||
- database_name: "{{ nova_database_name }}"
|
- database_name: "{{ nova_database_name }}"
|
||||||
|
database_username: "{{ nova_database_name }}"
|
||||||
|
database_password: "{{ nova_database_password }}"
|
||||||
|
- database_name: "{{ nova_database_name }}_cell0"
|
||||||
|
database_username: "{{ nova_database_name }}"
|
||||||
database_password: "{{ nova_database_password }}"
|
database_password: "{{ nova_database_password }}"
|
||||||
- database_name: "{{ nova_api_database_name }}"
|
- database_name: "{{ nova_api_database_name }}"
|
||||||
|
database_username: "{{ nova_api_database_name }}"
|
||||||
database_password: "{{ nova_api_database_password }}"
|
database_password: "{{ nova_api_database_password }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
@ -31,3 +31,5 @@
|
|||||||
|
|
||||||
- name: Flush handlers
|
- name: Flush handlers
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
- include: simple_cell_setup.yml
|
||||||
|
30
ansible/roles/nova/tasks/simple_cell_setup.yml
Normal file
30
ansible/roles/nova/tasks/simple_cell_setup.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- 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'
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
@ -6,6 +6,10 @@
|
|||||||
# It should be removed later
|
# It should be removed later
|
||||||
- include: bootstrap.yml
|
- include: bootstrap.yml
|
||||||
|
|
||||||
|
# TODO(Jeffrey4l): Since nova need setup nova cell in N->O, we need to call it.
|
||||||
|
# This should be removed later
|
||||||
|
- include: simple_cell_setup.yml
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
|
|
||||||
- include: register.yml
|
- include: register.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user