Merge "Create nova-api database"
This commit is contained in:
commit
7c264ca022
ansible/roles/nova
docker/nova/nova-api
etc/kolla
@ -21,6 +21,9 @@ nova_database_name: "nova"
|
|||||||
nova_database_user: "nova"
|
nova_database_user: "nova"
|
||||||
nova_database_address: "{{ kolla_internal_address }}"
|
nova_database_address: "{{ kolla_internal_address }}"
|
||||||
|
|
||||||
|
nova_api_database_name: "nova_api"
|
||||||
|
nova_api_database_user: "nova_api"
|
||||||
|
nova_api_database_address: "{{ kolla_internal_address }}"
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Docker
|
# Docker
|
||||||
|
@ -17,6 +17,24 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
|
||||||
|
- name: Creating Nova-api database
|
||||||
|
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
||||||
|
-m mysql_db
|
||||||
|
-a "login_host='{{ database_address }}'
|
||||||
|
login_user='{{ database_user }}'
|
||||||
|
login_password='{{ database_password }}'
|
||||||
|
name='{{ nova_api_database_name }}'"
|
||||||
|
register: database_api
|
||||||
|
changed_when: "{{ database_api.stdout.find('localhost | SUCCESS => ') != -1 and
|
||||||
|
(database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
failed_when: database_api.stdout.split()[2] != 'SUCCESS'
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
|
||||||
|
- name: Reading json from variable
|
||||||
|
set_fact:
|
||||||
|
database_api_created: "{{ (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
|
||||||
- name: Creating Nova database user and setting permissions
|
- name: Creating Nova database user and setting permissions
|
||||||
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
||||||
-m mysql_user
|
-m mysql_user
|
||||||
@ -35,6 +53,24 @@
|
|||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
|
||||||
|
- name: Creating Nova-api database user and setting permissions
|
||||||
|
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
||||||
|
-m mysql_user
|
||||||
|
-a "login_host='{{ database_address }}'
|
||||||
|
login_user='{{ database_user }}'
|
||||||
|
login_password='{{ database_password }}'
|
||||||
|
name='{{ nova_api_database_name }}'
|
||||||
|
password='{{ nova_api_database_password }}'
|
||||||
|
host='%'
|
||||||
|
priv='{{ nova_api_database_name }}.*:ALL'
|
||||||
|
append_privs='yes'"
|
||||||
|
register: database_api_user_create
|
||||||
|
changed_when: "{{ database_api_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
||||||
|
(database_api_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
failed_when: database_api_user_create.stdout.split()[2] != 'SUCCESS'
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
|
||||||
- name: Running Nova bootstrap container
|
- name: Running Nova bootstrap container
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
action: "start_container"
|
action: "start_container"
|
||||||
|
@ -125,6 +125,9 @@ password = {{ neutron_keystone_password }}
|
|||||||
[database]
|
[database]
|
||||||
connection = mysql+pymysql://{{ nova_database_user }}:{{ nova_database_password }}@{{ nova_database_address }}/{{ nova_database_name }}
|
connection = mysql+pymysql://{{ nova_database_user }}:{{ nova_database_password }}@{{ nova_database_address }}/{{ nova_database_name }}
|
||||||
|
|
||||||
|
[api_database]
|
||||||
|
connection = mysql+pymysql://{{ nova_api_database_user }}:{{ nova_api_database_password }}@{{ nova_api_database_address }}/{{ nova_api_database_name }}
|
||||||
|
|
||||||
[keystone_authtoken]
|
[keystone_authtoken]
|
||||||
auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
|
auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
|
||||||
auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
|
auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||||
nova-manage db sync
|
nova-manage db sync
|
||||||
|
nova-manage api_db sync
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -33,6 +33,7 @@ glance_database_password: "password"
|
|||||||
glance_keystone_password: "password"
|
glance_keystone_password: "password"
|
||||||
|
|
||||||
nova_database_password: "password"
|
nova_database_password: "password"
|
||||||
|
nova_api_database_password: "password"
|
||||||
nova_keystone_password: "password"
|
nova_keystone_password: "password"
|
||||||
|
|
||||||
neutron_database_password: "password"
|
neutron_database_password: "password"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user