Zaqar: support configurable backends
This patch updates the Zaqar profile so that we have support for configuring alternate versions of the messaging and management backends. In Pike instack-undercloud started using the swift/sqlalchemy backends and the intent here is to update the new containers undercloud to use a similar default (thus letting us drop Mongodb). Change-Id: Ie6a56b9163950cee2c0341afa0c0ddce665f3704
This commit is contained in:
parent
669f0dfe04
commit
096e913306
@ -22,6 +22,14 @@
|
|||||||
# (Optional) The hostname of the node responsible for bootstrapping tasks
|
# (Optional) The hostname of the node responsible for bootstrapping tasks
|
||||||
# Defaults to hiera('bootstrap_nodeid')
|
# Defaults to hiera('bootstrap_nodeid')
|
||||||
#
|
#
|
||||||
|
# [*management_store*]
|
||||||
|
# (Optional) The management store for Zaqar.
|
||||||
|
# Defaults to 'mongodb'
|
||||||
|
#
|
||||||
|
# [*messaging_store*]
|
||||||
|
# (Optional) The messaging store for Zaqar.
|
||||||
|
# Defaults to 'mongodb'
|
||||||
|
#
|
||||||
# [*step*]
|
# [*step*]
|
||||||
# (Optional) The current step in deployment. See tripleo-heat-templates
|
# (Optional) The current step in deployment. See tripleo-heat-templates
|
||||||
# for more details.
|
# for more details.
|
||||||
@ -29,6 +37,8 @@
|
|||||||
#
|
#
|
||||||
class tripleo::profile::base::zaqar (
|
class tripleo::profile::base::zaqar (
|
||||||
$bootstrap_node = hiera('bootstrap_nodeid', undef),
|
$bootstrap_node = hiera('bootstrap_nodeid', undef),
|
||||||
|
$management_store = 'mongodb',
|
||||||
|
$messaging_store = 'mongodb',
|
||||||
$step = Integer(hiera('step')),
|
$step = Integer(hiera('step')),
|
||||||
) {
|
) {
|
||||||
if $::hostname == downcase($bootstrap_node) {
|
if $::hostname == downcase($bootstrap_node) {
|
||||||
@ -40,22 +50,39 @@ class tripleo::profile::base::zaqar (
|
|||||||
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
|
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
|
||||||
include ::zaqar
|
include ::zaqar
|
||||||
|
|
||||||
if str2bool(hiera('mongodb::server::ipv6', false)) {
|
if $messaging_store == 'mongodb' or $management_store == 'mongodb' {
|
||||||
$mongo_node_ips_with_port_prefixed = prefix(hiera('mongodb_node_ips'), '[')
|
if str2bool(hiera('mongodb::server::ipv6', false)) {
|
||||||
$mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
|
$mongo_node_ips_with_port_prefixed = prefix(hiera('mongodb_node_ips'), '[')
|
||||||
} else {
|
$mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
|
||||||
$mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017')
|
} else {
|
||||||
|
$mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017')
|
||||||
|
}
|
||||||
|
$mongodb_replset = hiera('mongodb::server::replset')
|
||||||
|
$mongo_node_string = join($mongo_node_ips_with_port, ',')
|
||||||
|
$mongo_database_connection = "mongodb://${mongo_node_string}/zaqar?replicaSet=${mongodb_replset}"
|
||||||
}
|
}
|
||||||
$mongodb_replset = hiera('mongodb::server::replset')
|
|
||||||
$mongo_node_string = join($mongo_node_ips_with_port, ',')
|
|
||||||
$database_connection = "mongodb://${mongo_node_string}/zaqar?replicaSet=${mongodb_replset}"
|
|
||||||
|
|
||||||
class { '::zaqar::management::mongodb':
|
|
||||||
uri => $database_connection,
|
if $messaging_store == 'swift' {
|
||||||
|
include ::zaqar::messaging::swift
|
||||||
|
} elsif $messaging_store == 'mongodb' {
|
||||||
|
class {'::zaqar::messaging::mongodb':
|
||||||
|
uri => $mongo_database_connection,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fail("unsupported Zaqar messaging_store set: ${messaging_store}")
|
||||||
}
|
}
|
||||||
class {'::zaqar::messaging::mongodb':
|
|
||||||
uri => $database_connection,
|
if $management_store == 'sqlalchemy' {
|
||||||
|
include ::zaqar::management::sqlalchemy
|
||||||
|
} elsif $management_store == 'mongodb' {
|
||||||
|
class { '::zaqar::management::mongodb':
|
||||||
|
uri => $mongo_database_connection,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fail("unsupported Zaqar management_store set: ${management_store}")
|
||||||
}
|
}
|
||||||
|
|
||||||
include ::zaqar::transport::websocket
|
include ::zaqar::transport::websocket
|
||||||
include ::apache::mod::ssl
|
include ::apache::mod::ssl
|
||||||
include ::zaqar::transport::wsgi
|
include ::zaqar::transport::wsgi
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Support configurable backends Zaqar backends.
|
||||||
|
Updates the Zaqar profile so that we have support for configuring
|
||||||
|
alternate versions of the messaging and management backends.
|
Loading…
x
Reference in New Issue
Block a user