From 24bdf2da09caae91d9580d294b258e76316ced79 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Tue, 1 Dec 2015 10:15:29 +0200
Subject: [PATCH] Reconfigure when needed.

---
 tasks/main.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tasks/main.yml b/tasks/main.yml
index 1caec13..bc3f061 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -11,6 +11,7 @@
   with_items:
     - mysql-server/root_password
     - mysql-server/root_password_again
+  register: mysql_debconf
 
 - name: apt install
   apt:
@@ -24,6 +25,10 @@
     - python-mysqldb
     - cron
 
+- name: Reconfigure (if needed)
+  when: mysql_debconf.changed
+  command: /usr/sbin/dpkg-reconfigure --frontend noninteractive mysql-server-5.5
+
 - name: Add daily backup job
   copy:
     src: backup.sh
-- 
GitLab