2016-11-25 06:14:51 +08:00
|
|
|
---
|
|
|
|
- name: Creating Solum 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: "{{ solum_database_name }}"
|
2016-11-25 06:14:51 +08:00
|
|
|
register: database
|
|
|
|
run_once: True
|
|
|
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
2018-01-14 20:16:43 +02:00
|
|
|
when:
|
|
|
|
- not use_preconfigured_databases | bool
|
2016-11-25 06:14:51 +08:00
|
|
|
|
|
|
|
- name: Creating Solum 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: "{{ solum_database_user }}"
|
2016-12-28 23:52:55 +08:00
|
|
|
password: "{{ solum_database_password }}"
|
|
|
|
host: "%"
|
|
|
|
priv: "{{ solum_database_name }}.*:ALL"
|
|
|
|
append_privs: "yes"
|
2016-11-25 06:14:51 +08:00
|
|
|
run_once: True
|
|
|
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
2018-01-14 20:16:43 +02:00
|
|
|
when:
|
|
|
|
- not use_preconfigured_databases | bool
|
2016-11-25 06:14:51 +08:00
|
|
|
|
2018-07-23 12:58:02 +08:00
|
|
|
- include_tasks: bootstrap_service.yml
|
2018-01-14 20:16:43 +02:00
|
|
|
when: database.changed or use_preconfigured_databases | bool
|