From debde9c11b55b92b9712802f7abc7916ef6dc24b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 7 Nov 2017 15:32:49 -0200 Subject: Password field rename to authentication_string in some implementations --- manifests/server.pp | 11 +++++++++++ templates/setmysqlpass.sh.erb | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 3417119..3bdbf7b 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -8,6 +8,17 @@ class mysql::server( include mysql + $authentication_string = $::lsbdistid ? { + 'ubuntu' => $::lsbdistcodename ? { + 'trusty' => 'Password=PASSWORD', + 'xenial' => $implementation ? { + 'mysql-server' => 'authentication_string=password', + default => 'Password=PASSWORD', + }, + }, + default => 'Password=PASSWORD', + } + package { "mysql-server": name => $implementation, ensure => installed, diff --git a/templates/setmysqlpass.sh.erb b/templates/setmysqlpass.sh.erb index 3205e94..6e700f6 100644 --- a/templates/setmysqlpass.sh.erb +++ b/templates/setmysqlpass.sh.erb @@ -9,9 +9,9 @@ DEFAULTS="/etc/mysql/debian.cnf" # Run /usr/bin/mysql --defaults-file=$DEFAULTS <('$PASSWORD') WHERE User='root' AND Host='localhost'; +UPDATE mysql.user SET <%= @password_string %>('$PASSWORD') WHERE User='root' AND Host='<%= @fqdn %>'; +UPDATE mysql.user SET <%= @password_string %>('$PASSWORD') WHERE User='root' AND Host='127.0.0.1'; +UPDATE mysql.user SET <%= @password_string %>('$PASSWORD') WHERE User='root' AND Host='::1'; FLUSH PRIVILEGES; EOF -- cgit v1.2.3