}
}
-class mysql::server inherits mysql {
+class mysql::server(
+ $rootpw => hiera('mysql::server::rootpw', '')
+){
+ include mysql
+
package { "mysql-server":
ensure => installed,
}
require => Package["mysql-server"],
}
- case $mysql_rootpw {
- '': { fail("You need to define a mysql root password! Please set \$mysql_rootpw in your site.pp or host config") }
+ case $rootpw {
+ '': { fail("You need to define a mysql root password! Please set mysql::server::rootpw config") }
}
file { '/usr/local/sbin/setmysqlpass.sh':
mysql::cnf { "root":
home => "/root",
- passwd => $mysql_rootpw,
+ passwd => $rootpw,
}
define mysql::cnf($home, $passwd) {
- $mysql_passwd = $passwd
file { "$home/.my.cnf":
content => template('mysql/my.cnf.erb'),
require => Service['mysql'],