From 7e53d2e74e6afed0b4947819c2c0ccd2aeb53f10 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Fri, 3 Feb 2017 23:32:04 +0000 Subject: [PATCH] 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 --- ansible/roles/grafana/tasks/bootstrap.yml | 36 +++++++++++++---------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/ansible/roles/grafana/tasks/bootstrap.yml b/ansible/roles/grafana/tasks/bootstrap.yml index dba3614aec..85409917a1 100644 --- a/ansible/roles/grafana/tasks/bootstrap.yml +++ b/ansible/roles/grafana/tasks/bootstrap.yml @@ -1,24 +1,28 @@ --- - name: Creating grafana database - mysql_db: - login_host: "{{ database_address }}" - login_port: "{{ database_port }}" - login_user: "{{ database_user }}" - login_password: "{{ database_password }}" - name: "{{ grafana_database_name }}" + 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: "{{ grafana_database_name }}" run_once: True delegate_to: "{{ groups['grafana'][0] }}" - name: Creating grafana database user and setting permissions - mysql_user: - login_host: "{{ database_address }}" - login_port: "{{ database_port }}" - login_user: "{{ database_user }}" - login_password: "{{ database_password }}" - name: "{{ grafana_database_name }}" - password: "{{ grafana_database_password }}" - host: "%" - priv: "{{ grafana_database_name }}.*:ALL" - append_privs: "yes" + kolla_toolbox: + module_name: mysql_user + module_args: + login_host: "{{ database_address }}" + login_port: "{{ database_port }}" + login_user: "{{ database_user }}" + login_password: "{{ database_password }}" + name: "{{ grafana_database_name }}" + password: "{{ grafana_database_password }}" + host: "%" + priv: "{{ grafana_database_name }}.*:ALL" + append_privs: "yes" run_once: True delegate_to: "{{ groups['grafana'][0] }}"