Преглед на файлове

Fix mysql_root_password usage

Emmanuel Bouthenot преди 8 години
родител
ревизия
fd81806ebb
променени са 2 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 1 1
      roles/dbserver/defaults/main.yml
  2. 1 0
      roles/dbserver/tasks/mysql.yml

+ 1 - 1
roles/dbserver/defaults/main.yml

@@ -5,7 +5,7 @@
 with_mysql: False
 with_mariadb: False
 with_mysql_backup: True
-mysql_root_password: Null
+mysql_root_password: ''
 
 with_postgresql: False
 with_postgresql_backup: True

+ 1 - 0
roles/dbserver/tasks/mysql.yml

@@ -25,6 +25,7 @@
 
 - name: Change MySQL or MariaDB root default password
   raw: if ! echo "SELECT VERSION();" | mysql -u root --password='{{ mysql_root_password }}' >/dev/null 2>&1 ; then echo "UPDATE mysql.user SET Password=PASSWORD('{{ mysql_root_password }}') WHERE User IN ('', 'root'); FLUSH PRIVILEGES;" | mysql --defaults-file=/etc/mysql/debian.cnf ; fi
+  changed_when: False
   when: mysql_root_password != ''
 
 - name: Ensure MySQL or MariaDB is running