module-puppetlabs-mysql/manifests/server/root_password.pp
Igor Galić 333be5fd76 ensure /root/.my.cnf is 0600 and root owned
explicitly set /root/.my.cnf's owner and mode to ensure it will be
created with as root owned and 0600. This change fixes #357
2013-11-05 19:56:27 +01:00

21 lines
507 B
Puppet

#
class mysql::server::root_password {
$options = $mysql::server::options
# manage root password if it is set
if $mysql::server::root_password != 'UNSET' {
mysql_user { 'root@localhost':
ensure => present,
password_hash => mysql_password($mysql::server::root_password),
}
file { "${::root_home}/.my.cnf":
content => template('mysql/my.cnf.pass.erb'),
user => 'root',
mode => '0600',
require => Mysql_user['root@localhost'],
}
}
}