module-puppetlabs-mysql/manifests/server/root_password.pp
Brad Lodgen c9c5eb3fd1 (#MODULES-1058) root_password.pp cannot create /root/.my.cnf due to dependency
The dependency of creating the root .my.cnf file is a command which requires
the .my.cnf file. This patch removes that dependency. Without removing the
dependency, if a user already has a mysql server installed with a root password
and no root .my.cnf file, the module application will fail.
2015-01-27 17:42:03 -06:00

20 lines
460 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'),
owner => 'root',
mode => '0600',
}
}
}