From a2a9c17d515da6cdebd2ed0012cdcba442d174d5 Mon Sep 17 00:00:00 2001 From: Duong Ha-Quang Date: Wed, 1 Mar 2017 09:14:34 +0700 Subject: [PATCH] Fix Ceilometer cannot create MySQL database Due to kolla-toolbox return json object instead of just plain string, we can use the object directly. Change-Id: I55613f0f8ba97d1a14595c8c9b09e1ad6d2366e7 Closes-Bug: #1668521 --- ansible/roles/ceilometer/tasks/bootstrap.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/roles/ceilometer/tasks/bootstrap.yml b/ansible/roles/ceilometer/tasks/bootstrap.yml index bc00ac3050..716b31819b 100644 --- a/ansible/roles/ceilometer/tasks/bootstrap.yml +++ b/ansible/roles/ceilometer/tasks/bootstrap.yml @@ -9,7 +9,7 @@ when: - ceilometer_database_type == "mongodb" -- name: Checking Ceilometer mysql database +- name: Creating external Ceilometer MySQL database by using given credential kolla_toolbox: module_name: mysql_db module_args: @@ -25,7 +25,7 @@ when: - ceilometer_database_type == "mysql" -- name: Creating Ceilometer mysql database +- name: Fallback to create internal Ceilometer MySQL database kolla_toolbox: module_name: mysql_db module_args: @@ -39,7 +39,7 @@ delegate_to: "{{ groups['ceilometer-api'][0] }}" when: - ceilometer_database_type == "mysql" - - "'FAILED' in mysql_access.stdout" + - mysql_access.failed - name: Creating Ceilometer database user and setting permissions kolla_toolbox: @@ -58,7 +58,7 @@ delegate_to: "{{ groups['ceilometer-api'][0] }}" when: - ceilometer_database_type == "mysql" - - "'FAILED' in mysql_access.stdout" + - mysql_access.failed # TODO(Jeffrey4l): fix idempotent when ceilometer_database_type == "gnocchi" # NOTE(vbel): bootstrapping of mysql db for ceilometer is idempotent