diff options
author | Emilien Macchi <emilien@redhat.com> | 2015-03-18 12:01:20 -0400 |
---|---|---|
committer | Yanis Guenane <yanis.guenane@enovance.com> | 2015-04-14 15:55:01 +0200 |
commit | 1c3bd1feaa2988003a7189bfc1fe4cd9ea580259 (patch) | |
tree | cd4389b6ffc7e671e8c8b404302d44069f89e05f /puppet/manifests/overcloud_controller.pp | |
parent | bafe58c42d2c0c58346fce929cf443c0436b6cd5 (diff) |
puppet: implement MongoDB on controller nodes
This patch aims to configure MongoDB server on controller nodes with
Puppet.
It also create a default replicaset for Ceilometer, so MongoDB can be
highly available when multiple controllers are run.
Change-Id: I3c1ff06ebc3c9dac44fc790caaea711d0eba4bb7
Diffstat (limited to 'puppet/manifests/overcloud_controller.pp')
-rw-r--r-- | puppet/manifests/overcloud_controller.pp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp index 3e3f2e70..0541fa4e 100644 --- a/puppet/manifests/overcloud_controller.pp +++ b/puppet/manifests/overcloud_controller.pp @@ -39,6 +39,21 @@ if hiera('step') >= 2 { include ::ntp } + # MongoDB + include ::mongodb::globals + include ::mongodb::server + $mongo_node_ips = split(downcase(hiera('mongo_node_ips')), ',') + $mongo_node_ips_with_port = suffix($mongo_node_ips, ':27017') + + if count($mongo_node_ips) > 1 { + if downcase($::hostname) == hiera('bootstrap_nodeid') { + $mongodb_replset = hiera('mongodb::server::replset') + mongodb_replset { $mongodb_replset : + members => $mongo_node_ips_with_port, + } + } + } + if str2bool(hiera('enable_galera', 'true')) { $mysql_config_file = '/etc/my.cnf.d/galera.cnf' } else { |