Add DB-connection to the congress.pp manifest
This commit is contained in:
parent
cf42368880
commit
8fd355d45a
|
@ -12,6 +12,25 @@ $rabbit_hosts = split(hiera('amqp_hosts',''), ',')
|
|||
$rabbit_password = $rabbit_hash['password']
|
||||
$rabbit_userid = $rabbit_hash['user']
|
||||
|
||||
$database_vip = hiera('database_vip', undef)
|
||||
$db_type = 'mysql'
|
||||
$db_host = pick($congress_hash['db_host'], $database_vip)
|
||||
$db_user = pick($congress_hash['username'], 'congress')
|
||||
$db_password = $congress_hash['db_password']
|
||||
$db_name = pick($congress_hash['db_name'], 'congress')
|
||||
|
||||
$db_connection = os_database_connection({
|
||||
'dialect' => $db_type,
|
||||
'host' => $db_host,
|
||||
'database' => $db_name,
|
||||
'username' => $db_user,
|
||||
'password' => $db_password,
|
||||
'charset' => 'utf8'
|
||||
})
|
||||
|
||||
class {'congress::db':
|
||||
connection => $db_connection
|
||||
}
|
||||
|
||||
class { 'congress':
|
||||
rabbit_hosts => $rabbit_hosts,
|
||||
|
|
Loading…
Reference in New Issue