2013-09-09 17:34:39 +02:00
|
|
|
#
|
|
|
|
class mysql::server::root_password {
|
|
|
|
|
2013-09-25 00:04:29 +02:00
|
|
|
$options = $mysql::server::options
|
2013-09-09 17:34:39 +02:00
|
|
|
|
|
|
|
# manage root password if it is set
|
2014-10-06 10:53:30 +02:00
|
|
|
if $mysql::server::create_root_user == true and $mysql::server::root_password != 'UNSET' {
|
2013-09-13 19:04:42 +02:00
|
|
|
mysql_user { 'root@localhost':
|
|
|
|
ensure => present,
|
|
|
|
password_hash => mysql_password($mysql::server::root_password),
|
2013-09-09 17:34:39 +02:00
|
|
|
}
|
2014-10-06 10:53:30 +02:00
|
|
|
}
|
2013-09-09 17:34:39 +02:00
|
|
|
|
2014-10-06 10:53:30 +02:00
|
|
|
if $mysql::server::create_root_my_cnf == true and $mysql::server::root_password != 'UNSET' {
|
2013-09-09 17:34:39 +02:00
|
|
|
file { "${::root_home}/.my.cnf":
|
|
|
|
content => template('mysql/my.cnf.pass.erb'),
|
2013-11-06 17:36:55 +01:00
|
|
|
owner => 'root',
|
2013-11-05 19:56:27 +01:00
|
|
|
mode => '0600',
|
2013-09-13 19:04:42 +02:00
|
|
|
require => Mysql_user['root@localhost'],
|
2013-09-09 17:34:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|