puppet-designate/manifests/db.pp
Yanis Guenane 3d4879dc4d Creation of designate::db::sync
In order to standardize the way dbsync are run across our modules,
we create a new class designate::db::sync and
designate::db::powerdns::sync.
Those classes will be included if sync_db is enabled.

By making this transition the designate::db::sync class and the powerdns
related one can be returned by the ENC.

A use case would be in an highly available environment, with 3 galera
nodes, include designate::db on every node with sync_db set to false
and have the ENC return designate::db::sync just for one node.

Change-Id: I3e14b82055cfadf3274d6657413668b11f28ec49
2015-09-08 11:26:12 +02:00

42 lines
886 B
Puppet

# == Class designate::db
#
# Configures the designate database
#
# This class will install the required libraries depending on the driver
# specified in the connection_string parameter
#
# == Parameters
#
# [*database_connection*]
# the connection string. format: [driver]://[user]:[password]@[host]/[database]
#
# [*sync_db*]
# Enable dbsync.
#
class designate::db (
$database_connection = 'mysql://designate:designate@localhost/designate',
$sync_db = true,
) {
include ::designate::params
case $database_connection {
/^mysql:\/\//: {
require 'mysql::bindings'
require 'mysql::bindings::python'
}
default: {
fail('Unsupported backend configured')
}
}
designate_config {
'storage:sqlalchemy/connection': value => $database_connection, secret => true;
}
if $sync_db {
include ::designate::db::sync
}
}