aboutsummaryrefslogtreecommitdiffstats
path: root/puppet
diff options
context:
space:
mode:
authorCarlos Camacho <ccamacho@redhat.com>2016-05-11 15:51:36 +0200
committerCarlos Camacho <ccamacho@redhat.com>2016-06-12 21:25:39 +0000
commit11074fb08f5bb86b1b84065ec1bfada3ad387053 (patch)
tree210845b03f6b250b5e357fddd411e0d8a88f542f /puppet
parent184dba99c1a11c0a5b82bb10b8fec301d1eb1437 (diff)
Composable roles within services - MongoDB
Add MongoDB as a composable service. Co-Authored-By: Juan Antonio Osorio Robles <jaosorior@redhat.com> Change-Id: Idaa3275def3bcdb302a66fc1c88531ff718bcf67 Depends-On: Idb1e78ebec7682fe68ca5902a22cfb6030498091
Diffstat (limited to 'puppet')
-rw-r--r--puppet/controller.yaml14
-rw-r--r--puppet/manifests/overcloud_controller.pp8
-rw-r--r--puppet/manifests/overcloud_controller_pacemaker.pp25
-rw-r--r--puppet/services/database/mongodb-base.yaml30
-rw-r--r--puppet/services/database/mongodb.yaml28
-rw-r--r--puppet/services/pacemaker/database/mongodb.yaml28
6 files changed, 90 insertions, 43 deletions
diff --git a/puppet/controller.yaml b/puppet/controller.yaml
index 66a5d5e5..aaf87707 100644
--- a/puppet/controller.yaml
+++ b/puppet/controller.yaml
@@ -300,14 +300,6 @@ parameters:
default: 0
description: Number of workers for Nova service.
type: number
- MongoDbNoJournal:
- default: false
- description: Should MongoDb journaling be disabled
- type: boolean
- MongoDbIPv6:
- default: false
- description: Enable IPv6 if Mongo DB VIP is IPv6
- type: boolean
NtpServer:
default: ''
description: Comma-separated list of ntp servers
@@ -768,8 +760,6 @@ resources:
rabbit_cookie: {get_param: RabbitCookie}
rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
rabbit_client_port: {get_param: RabbitClientPort}
- mongodb_no_journal: {get_param: MongoDbNoJournal}
- mongodb_ipv6: {get_param: MongoDbIPv6}
ntp_servers: {get_param: NtpServer}
timezone: {get_param: TimeZone}
control_virtual_interface: {get_param: ControlVirtualInterface}
@@ -936,10 +926,10 @@ resources:
keystone::public_bind_host: {get_input: keystone_public_api_network}
keystone::wsgi::apache::bind_host: {get_input: keystone_public_api_network}
keystone::wsgi::apache::admin_bind_host: {get_input: keystone_admin_api_network}
+
# MongoDB
mongodb::server::bind_ip: {get_input: mongo_db_network}
- mongodb::server::nojournal: {get_input: mongodb_no_journal}
- mongodb::server::ipv6: {get_input: mongodb_ipv6}
+
# MySQL
admin_password: {get_input: admin_password}
enable_galera: {get_input: enable_galera}
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp
index 872e7c88..95c933d4 100644
--- a/puppet/manifests/overcloud_controller.pp
+++ b/puppet/manifests/overcloud_controller.pp
@@ -36,9 +36,6 @@ if hiera('step') >= 2 {
# MongoDB
if downcase(hiera('ceilometer_backend')) == 'mongodb' {
- include ::mongodb::globals
- include ::mongodb::client
- include ::mongodb::server
# NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
# without the brackets as 'members' argument for the 'mongodb_replset'
# resource.
@@ -54,11 +51,6 @@ if hiera('step') >= 2 {
$mongodb_replset = hiera('mongodb::server::replset')
$ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
- if downcase(hiera('bootstrap_nodeid')) == $::hostname {
- mongodb_replset { $mongodb_replset :
- members => $mongo_node_ips_with_port_nobr,
- }
- }
}
if str2bool(hiera('enable_galera', true)) {
diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp
index ee513a0d..614f23ba 100644
--- a/puppet/manifests/overcloud_controller_pacemaker.pp
+++ b/puppet/manifests/overcloud_controller_pacemaker.pp
@@ -100,11 +100,7 @@ if hiera('step') >= 1 {
}
if downcase(hiera('ceilometer_backend')) == 'mongodb' {
- include ::mongodb::globals
- include ::mongodb::client
- class { '::mongodb::server' :
- service_manage => false,
- }
+ include ::mongodb::params
}
# Galera
@@ -166,6 +162,7 @@ if hiera('step') >= 1 {
if hiera('step') >= 2 {
+
# NOTE(gfidente): the following vars are needed on all nodes so they
# need to stay out of pacemaker_master conditional.
# The addresses mangling will hopefully go away when we'll be able to
@@ -192,24 +189,6 @@ if hiera('step') >= 2 {
clone_params => true,
}
- if downcase(hiera('ceilometer_backend')) == 'mongodb' {
- pacemaker::resource::service { $::mongodb::params::service_name :
- op_params => 'start timeout=370s stop timeout=200s',
- clone_params => true,
- require => Class['::mongodb::server'],
- }
- # NOTE (spredzy) : The replset can only be run
- # once all the nodes have joined the cluster.
- mongodb_conn_validator { $mongo_node_ips_with_port :
- timeout => '600',
- require => Pacemaker::Resource::Service[$::mongodb::params::service_name],
- before => Mongodb_replset[$mongodb_replset],
- }
- mongodb_replset { $mongodb_replset :
- members => $mongo_node_ips_with_port_nobr,
- }
- }
-
pacemaker::resource::ocf { 'galera' :
ocf_agent_name => 'heartbeat:galera',
op_params => 'promote timeout=300s on-fail=block',
diff --git a/puppet/services/database/mongodb-base.yaml b/puppet/services/database/mongodb-base.yaml
new file mode 100644
index 00000000..ecd1d319
--- /dev/null
+++ b/puppet/services/database/mongodb-base.yaml
@@ -0,0 +1,30 @@
+heat_template_version: 2016-04-08
+
+description: >
+ Configuration details for MongoDB service using composable roles
+
+parameters:
+ MongoDbNoJournal:
+ default: false
+ description: Should MongoDb journaling be disabled
+ type: boolean
+ MongoDbIPv6:
+ default: false
+ description: Enable IPv6 if MongoDB VIP is IPv6
+ type: boolean
+ MongoDbReplset:
+ type: string
+ default: "tripleo"
+
+outputs:
+ aux_parameters:
+ description: Additional parameters referenced outside the base file
+ value:
+ rplset_name: {get_param: MongoDbReplset}
+ role_data:
+ description: Role data for the MongoDB base service.
+ value:
+ config_settings:
+ mongodb::server::nojournal: {get_param: MongoDbNoJournal}
+ mongodb::server::ipv6: {get_param: MongoDbIPv6}
+ mongodb::server::replset: {get_param: MongoDbReplset} \ No newline at end of file
diff --git a/puppet/services/database/mongodb.yaml b/puppet/services/database/mongodb.yaml
new file mode 100644
index 00000000..c0488700
--- /dev/null
+++ b/puppet/services/database/mongodb.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2016-04-08
+
+description: >
+ MongoDb service deployment using puppet
+
+parameters:
+ #Parameters not used EndpointMap
+ EndpointMap:
+ default: {}
+ description: Mapping of service endpoint -> protocol. Typically set
+ via parameter_defaults in the resource registry.
+ type: json
+
+resources:
+ MongoDbBase:
+ type: ./mongodb-base.yaml
+
+outputs:
+ role_data:
+ description: Service mongodb using composable services.
+ value:
+ config_settings:
+ map_merge:
+ - get_attr: [MongoDbBase, role_data, config_settings]
+ - tripleo::profile::base::database::mongodb::mongodb_replset: {get_attr: [MongoDbBase, aux_parameters, rplset_name]}
+ mongodb::server::service_manage: True
+ step_config: |
+ include ::tripleo::profile::base::database::mongodb \ No newline at end of file
diff --git a/puppet/services/pacemaker/database/mongodb.yaml b/puppet/services/pacemaker/database/mongodb.yaml
new file mode 100644
index 00000000..b2e9e0bb
--- /dev/null
+++ b/puppet/services/pacemaker/database/mongodb.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2016-04-08
+
+description: >
+ MongoDb service deployment using puppet
+
+parameters:
+ #Parameters not used EndpointMap
+ EndpointMap:
+ default: {}
+ description: Mapping of service endpoint -> protocol. Typically set
+ via parameter_defaults in the resource registry.
+ type: json
+
+resources:
+ MongoDbBase:
+ type: ../../database/mongodb-base.yaml
+
+outputs:
+ role_data:
+ description: Service mongodb using composable services.
+ value:
+ config_settings:
+ map_merge:
+ - get_attr: [MongoDbBase, role_data, config_settings]
+ - tripleo::profile::pacemaker::database::mongodb::mongodb_replset: {get_attr: [MongoDbBase, aux_parameters, rplset_name]}
+ mongodb::server::service_manage: False
+ step_config: |
+ include ::tripleo::profile::pacemaker::database::mongodb