From aece209f4ce79962d8ece67b107310bf5c05ba05 Mon Sep 17 00:00:00 2001
From: Jafar Lie <jafar.lie@monash.edu>
Date: Fri, 13 Mar 2020 10:39:43 +1100
Subject: [PATCH] fixed roles for mysql

Former-commit-id: 543d97db75bc13b62ef6ce9c354626bf24c93850
---
 roles/mysql/tasks/Ubuntu_18_mysql_server.yml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/roles/mysql/tasks/Ubuntu_18_mysql_server.yml b/roles/mysql/tasks/Ubuntu_18_mysql_server.yml
index 1a1fbd4a..fdaf9afa 100644
--- a/roles/mysql/tasks/Ubuntu_18_mysql_server.yml
+++ b/roles/mysql/tasks/Ubuntu_18_mysql_server.yml
@@ -30,12 +30,18 @@
 
 - name: "Adding user database"
   mysql_db: name={{ mysql_user_db_name }} state=present login_user=root login_password={{ mysql_root_password }}
+  become: true
+  become_user: root
 
 - name: "Giving priviliges to user"
   mysql_user: name={{ mysql_user_name }} host={{ mysql_user_host }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present
   when: mysql_user_host is defined
+  become: true
+  become_user: root
 
 - name: "Giving priviliges to user"
   mysql_user: name={{ mysql_user_name }} host={{ hostvars[item].ansible_fqdn }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present
   with_items: "{{ mysql_user_hosts_group }}"
   when: mysql_user_hosts_group is defined
+  become: true
+  become_user: root
\ No newline at end of file
-- 
GitLab