Fix grafana database creation

Kolla use kolla_toolbox container to interact
with the database.
Grafana fails to deploy if mysql-python is not installed
in the host.

Change-Id: I033f1828ff027532de9be94aaf7dee6dbeab8fb6
Closes-Bug: #1661646
This commit is contained in:
Eduardo Gonzalez 2017-02-03 23:32:04 +00:00
parent 83d99ecf0c
commit 7e53d2e74e

View File

@ -1,24 +1,28 @@
--- ---
- name: Creating grafana database - name: Creating grafana database
mysql_db: kolla_toolbox:
login_host: "{{ database_address }}" module_name: mysql_db
login_port: "{{ database_port }}" module_args:
login_user: "{{ database_user }}" login_host: "{{ database_address }}"
login_password: "{{ database_password }}" login_port: "{{ database_port }}"
name: "{{ grafana_database_name }}" login_user: "{{ database_user }}"
login_password: "{{ database_password }}"
name: "{{ grafana_database_name }}"
run_once: True run_once: True
delegate_to: "{{ groups['grafana'][0] }}" delegate_to: "{{ groups['grafana'][0] }}"
- name: Creating grafana database user and setting permissions - name: Creating grafana database user and setting permissions
mysql_user: kolla_toolbox:
login_host: "{{ database_address }}" module_name: mysql_user
login_port: "{{ database_port }}" module_args:
login_user: "{{ database_user }}" login_host: "{{ database_address }}"
login_password: "{{ database_password }}" login_port: "{{ database_port }}"
name: "{{ grafana_database_name }}" login_user: "{{ database_user }}"
password: "{{ grafana_database_password }}" login_password: "{{ database_password }}"
host: "%" name: "{{ grafana_database_name }}"
priv: "{{ grafana_database_name }}.*:ALL" password: "{{ grafana_database_password }}"
append_privs: "yes" host: "%"
priv: "{{ grafana_database_name }}.*:ALL"
append_privs: "yes"
run_once: True run_once: True
delegate_to: "{{ groups['grafana'][0] }}" delegate_to: "{{ groups['grafana'][0] }}"