Explorar o código

Fix silly bug while trying to update mysql root password

Emmanuel Bouthenot %!s(int64=9) %!d(string=hai) anos
pai
achega
aec1917e3a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      roles/dbserver/tasks/mysql.yml

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

@@ -13,7 +13,7 @@
   when: with_mysql
 
 - name: Change mysql root default password
-  raw: if "SELECT VERSION();" | mysql -u root >/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
+  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
   when: with_mysql
 
 - name: Ensure mysql-server is running