puppet-lint fixes

This commit is contained in:
Florian Haas 2013-07-27 07:51:15 +02:00
parent 50dba6885f
commit 5151a974a4
2 changed files with 20 additions and 17 deletions

View File

@ -1,17 +1,17 @@
class kickstack::database inherits kickstack {
case $database {
case $::kickstack::database {
'mysql': {
$mysql_service = 'mysql'
ensure_resource('class',
'mysql::server',
{ config_hash => {
'root_password' => "$mysql_root_password",
'bind_address' => "0.0.0.0"
'root_password' => $::kickstack::mysql_root_password,
'bind_address' => '0.0.0.0'
}})
ensure_resource('file',
'/etc/mysql/conf.d/skip-name-resolve.cnf',
{ source => "puppet:///modules/kickstack/mysql/skip-name-resolve.cnf",
{ source => 'puppet:///modules/kickstack/mysql/skip-name-resolve.cnf',
})
}
'postgresql': {
@ -19,9 +19,12 @@ class kickstack::database inherits kickstack {
'postgresql::server',
{ config_hash => {
'ip_mask_deny_postgres_user' => '0.0.0.0/32',
'ip_mask_allow_all_users' => '0.0.0.0/0',
'listen_addresses' => '*',
'postgres_password' => "$postgres_password"}})
'ip_mask_allow_all_users' => '0.0.0.0/0',
'listen_addresses' => '*',
'postgres_password' => $kickstack::postgres_password }})
}
default: {
fail("Unsupported value for \$::kickstack::database: ${::kickstack::database}")
}
}

View File

@ -15,9 +15,9 @@ define kickstack::db {
$sql_password = $sql_connection ? {
undef => pwgen(),
default => pick(regsubst(getvar("${fact_prefix}${servicename}_sql_connection"),
".*://${username}:(.*)@.*/${servicename}",
'\1'),
pwgen())
".*://${username}:(.*)@.*/${servicename}",
'\1'),
pwgen())
}
# Export facts about the database only after configuring the database
@ -28,18 +28,18 @@ define kickstack::db {
# If running on mysql, set the "allowed_hosts" parameter to % so we
# can connect to the database from anywhere.
case "${database}" {
"mysql": {
'mysql': {
class { "${servicename}::db::mysql":
user => "$username",
password => "$sql_password",
charset => "utf8",
allowed_hosts => '%',
notify => Kickstack::Exportfact::Export["${name}_sql_connection"]
user => $username,
password => $sql_password,
charset => 'utf8',
allowed_hosts => '%',
notify => Kickstack::Exportfact::Export["${name}_sql_connection"]
}
}
default: {
class { "${name}::db::${database}":
password => "$sql_password"
password => $sql_password
}
}
}