refactor things for >2.7

This commit is contained in:
mh 2012-06-08 13:04:06 -03:00
parent 7f4ae6753f
commit e4ca510b7c
7 changed files with 113 additions and 113 deletions

View file

@ -1,6 +1,6 @@
class mysql::client::ruby {
case $operatingsystem {
case $::operatingsystem {
debian: { include mysql::client::ruby::debian }
}

View file

@ -11,21 +11,21 @@ define mysql::default_database(
'absent' => $name,
default => $username
}
mysql_database{"$name":
mysql_database{$name:
ensure => $ensure
}
if $password == 'absent' and $ensure != 'absent' {
info("we don't create the user for database: ${name}")
$grant_require = Mysql_database["$name"]
$grant_require = Mysql_database[$name]
} else {
mysql_user{"${real_username}@${host}":
ensure => $ensure,
require => [
Mysql_database["$name"]
Mysql_database[$name]
],
}
$grant_require = [
Mysql_database["$name"],
Mysql_database[$name],
Mysql_user["${real_username}@${host}"]
]
if $ensure == 'present' {
@ -33,7 +33,7 @@ define mysql::default_database(
password_hash => $password ? {
'trocla' => trocla("mysql_${real_username}",'mysql'),
default => $password_is_encrypted ? {
true => "$password",
true => $password,
default => mysql_password("$password")
},
},
@ -42,7 +42,7 @@ define mysql::default_database(
}
if $ensure == 'present' {
mysql_grant{"${real_username}@${host}/${name}":
privileges => "$privileges",
privileges => $privileges,
require => $grant_require,
}
}

View file

@ -1,5 +1,5 @@
class mysql::devel{
package{"mysql-devel.${architecture}":
package{"mysql-devel.${::architecture}":
ensure => present,
}
}

View file

@ -1,7 +1,7 @@
class mysql::server::account_security {
# some installations have some default users which are not required.
# We remove them here. You can subclass this class to overwrite this behavior.
mysql_user{ [ "root@${fqdn}", "root@127.0.0.1", "@${fqdn}", "@localhost", "@%" ]:
mysql_user{ [ "root@${::fqdn}", "root@127.0.0.1", "@${::fqdn}", "@localhost", "@%" ]:
ensure => 'absent',
require => Service['mysql'],
}

View file

@ -5,10 +5,10 @@ class mysql::server::base {
file { 'mysql_main_cnf':
path => '/etc/mysql/my.cnf',
source => [
"puppet:///modules/site-mysql/${::fqdn}/my.cnf",
"puppet:///modules/site-mysql/my.cnf.${::operatingsystem}.{lsbdistcodename}",
"puppet:///modules/site-mysql/my.cnf.${::operatingsystem}",
"puppet:///modules/site-mysql/my.cnf",
"puppet:///modules/site_mysql/${::fqdn}/my.cnf",
"puppet:///modules/site_mysql/my.cnf.${::operatingsystem}.{lsbdistcodename}",
"puppet:///modules/site_mysql/my.cnf.${::operatingsystem}",
"puppet:///modules/site_mysql/my.cnf",
"puppet:///modules/mysql/config/my.cnf.${::operatingsystem}.{lsbdistcodename}",
"puppet:///modules/mysql/config/my.cnf.${::operatingsystem}",
"puppet:///modules/mysql/config/my.cnf"