2016-03-01 10:46:48 -05:00
|
|
|
---
|
|
|
|
- name: Creating Manila database
|
2016-12-28 23:52:55 +08:00
|
|
|
kolla_toolbox:
|
|
|
|
module_name: mysql_db
|
|
|
|
module_args:
|
|
|
|
login_host: "{{ database_address }}"
|
|
|
|
login_port: "{{ database_port }}"
|
|
|
|
login_user: "{{ database_user }}"
|
|
|
|
login_password: "{{ database_password }}"
|
|
|
|
name: "{{ manila_database_name }}"
|
2016-03-01 10:46:48 -05:00
|
|
|
register: database
|
|
|
|
run_once: True
|
|
|
|
delegate_to: "{{ groups['manila-api'][0] }}"
|
2018-01-14 20:16:43 +02:00
|
|
|
when:
|
|
|
|
- not use_preconfigured_databases | bool
|
2016-03-01 10:46:48 -05:00
|
|
|
|
|
|
|
- name: Creating Manila database user and setting permissions
|
2016-12-28 23:52:55 +08:00
|
|
|
kolla_toolbox:
|
|
|
|
module_name: mysql_user
|
|
|
|
module_args:
|
|
|
|
login_host: "{{ database_address }}"
|
|
|
|
login_port: "{{ database_port }}"
|
|
|
|
login_user: "{{ database_user }}"
|
|
|
|
login_password: "{{ database_password }}"
|
2017-06-19 14:24:48 +08:00
|
|
|
name: "{{ manila_database_user }}"
|
2016-12-28 23:52:55 +08:00
|
|
|
password: "{{ manila_database_password }}"
|
|
|
|
host: "%"
|
|
|
|
priv: "{{ manila_database_name }}.*:ALL"
|
|
|
|
append_privs: "yes"
|
2016-03-01 10:46:48 -05:00
|
|
|
run_once: True
|
|
|
|
delegate_to: "{{ groups['manila-api'][0] }}"
|
2018-01-14 20:16:43 +02:00
|
|
|
when:
|
|
|
|
- not use_preconfigured_databases | bool
|
2016-03-01 10:46:48 -05:00
|
|
|
|
2016-03-04 11:07:41 -05:00
|
|
|
- include: bootstrap_service.yml
|
2018-01-14 20:16:43 +02:00
|
|
|
when: database.changed or use_preconfigured_databases | bool
|