diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-25 16:05:43 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-25 16:05:43 -0200 |
commit | 8f23dc4b9e0cd86385d5c864dbac0e1ef550c700 (patch) | |
tree | 387fffa767bd71fffeaae65995279deca0fb170e /manifests | |
parent | 9ad7371b4639d69001ea08e8beceee42dbfdaea7 (diff) | |
download | puppet-mysql-8f23dc4b9e0cd86385d5c864dbac0e1ef550c700.tar.gz puppet-mysql-8f23dc4b9e0cd86385d5c864dbac0e1ef550c700.tar.bz2 |
Switching to parametrized class and hiera
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 16904fe..cbb57e0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,7 +18,11 @@ class mysql { } } -class mysql::server inherits mysql { +class mysql::server( + $rootpw => hiera('mysql::server::rootpw', '') +){ + include mysql + package { "mysql-server": ensure => installed, } @@ -31,8 +35,8 @@ class mysql::server inherits mysql { 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': @@ -52,11 +56,10 @@ class mysql::server inherits mysql { 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'], |