From de56340f8691d16c7a50a0b0e222647388946ba4 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Mon, 18 Sep 2017 17:16:52 +0100
Subject: [PATCH] Fix kolla-ansible genconfig for mariadb

For the genconfig command, master_host will not be defined as it is
defined dynamically in bootstrap.yml.

Co-Authored-By: Stig Telfer <stig@stackhpc.com>
Change-Id: Ib988c8e2de475e9b973fed2f7f752cb2500953c3
Closes-Bug: #1707856
---
 ansible/roles/mariadb/handlers/main.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ansible/roles/mariadb/handlers/main.yml b/ansible/roles/mariadb/handlers/main.yml
index 2e74012878..fcc04f767b 100644
--- a/ansible/roles/mariadb/handlers/main.yml
+++ b/ansible/roles/mariadb/handlers/main.yml
@@ -53,6 +53,7 @@
     image: "{{ service.image }}"
     volumes: "{{ service.volumes }}"
   when:
+    - action != "config"
     - inventory_hostname != master_host
     - inventory_hostname in groups[service.group]
     - service.enabled | bool
@@ -78,6 +79,7 @@
   retries: 10
   delay: 6
   when:
+    - action != "config"
     - inventory_hostname != master_host
 
 - name: restart master mariadb
@@ -92,6 +94,7 @@
     image: "{{ service.image }}"
     volumes: "{{ service.volumes }}"
   when:
+    - action != "config"
     - inventory_hostname == master_host
     - inventory_hostname in groups[service.group]
     - service.enabled | bool
@@ -117,4 +120,5 @@
   retries: 10
   delay: 6
   when:
+    - action != "config"
     - inventory_hostname == master_host