diff options
Diffstat (limited to 'manifests/profile/pacemaker')
-rw-r--r-- | manifests/profile/pacemaker/database/mongodb.pp | 74 | ||||
-rw-r--r-- | manifests/profile/pacemaker/database/mongodbvalidator.pp | 37 | ||||
-rw-r--r-- | manifests/profile/pacemaker/keystone.pp | 7 | ||||
-rw-r--r-- | manifests/profile/pacemaker/neutron.pp | 5 | ||||
-rw-r--r-- | manifests/profile/pacemaker/neutron/ml2.pp | 15 | ||||
-rw-r--r-- | manifests/profile/pacemaker/neutron/plugins/plumgrid.pp | 33 | ||||
-rw-r--r-- | manifests/profile/pacemaker/neutron/server.pp | 22 | ||||
-rw-r--r-- | manifests/profile/pacemaker/nova.pp | 4 | ||||
-rw-r--r-- | manifests/profile/pacemaker/nova/api.pp | 48 | ||||
-rw-r--r-- | manifests/profile/pacemaker/nova/consoleauth.pp | 45 | ||||
-rw-r--r-- | manifests/profile/pacemaker/nova/scheduler.pp | 45 | ||||
-rw-r--r-- | manifests/profile/pacemaker/nova/vncproxy.pp | 45 |
12 files changed, 362 insertions, 18 deletions
diff --git a/manifests/profile/pacemaker/database/mongodb.pp b/manifests/profile/pacemaker/database/mongodb.pp new file mode 100644 index 0000000..15c84d7 --- /dev/null +++ b/manifests/profile/pacemaker/database/mongodb.pp @@ -0,0 +1,74 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::database::mongodb +# +# Mongodb Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*mongodb_replset*] +# Mongodb replicaset name +# +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::pacemaker::database::mongodb ( + $mongodb_replset, + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + if $step >= 1 { + include ::mongodb::globals + include ::mongodb::client + include ::mongodb::server + } + + if $step >= 2 { + + include ::tripleo::profile::base::database::mongodbcommon + + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + if $pacemaker_master { + 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. + tripleo::profile::pacemaker::database::mongodbvalidator { + $tripleo::profile::base::database::mongodbcommon::mongodb_node_ips : + port => $tripleo::profile::base::database::mongodbcommon::port, + require => Pacemaker::Resource::Service[$::mongodb::params::service_name], + before => Mongodb_replset[$mongodb_replset], + } + mongodb_replset { $mongodb_replset : + members => $tripleo::profile::base::database::mongodbcommon::mongo_node_ips_with_port_nobr, + } + } + } +} diff --git a/manifests/profile/pacemaker/database/mongodbvalidator.pp b/manifests/profile/pacemaker/database/mongodbvalidator.pp new file mode 100644 index 0000000..95d3bd7 --- /dev/null +++ b/manifests/profile/pacemaker/database/mongodbvalidator.pp @@ -0,0 +1,37 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::database::mongodb::conn_validator +# +# Connection validator for a node that serves MongoDB. This is done to be able +# to iterate through the different servers in a more seamless way. +# +# === Parameters +# +# [*title*] +# the title or namevar of the resource will be used as the server of the +# actual mongodb_conn_validator. +# +# [*port*] +# The port in which the MongoDB server is listening on. +# +define tripleo::profile::pacemaker::database::mongodbvalidator( + $port, +) { + mongodb_conn_validator { "${title}_conn_validator" : + server => $title, + port => $port, + timeout => '600', + } +} diff --git a/manifests/profile/pacemaker/keystone.pp b/manifests/profile/pacemaker/keystone.pp index 42c44d4..497d6f3 100644 --- a/manifests/profile/pacemaker/keystone.pp +++ b/manifests/profile/pacemaker/keystone.pp @@ -59,10 +59,9 @@ class tripleo::profile::pacemaker::keystone ( } class { '::tripleo::profile::base::keystone': - sync_db => $pacemaker_master, - bootstrap_master => $pacemaker_master, - manage_roles => $manage_roles, - manage_endpoint => $manage_roles + sync_db => $pacemaker_master, + manage_roles => $manage_roles, + manage_endpoint => $manage_roles } if $step >= 5 and $pacemaker_master and $enable_load_balancer { diff --git a/manifests/profile/pacemaker/neutron.pp b/manifests/profile/pacemaker/neutron.pp index 03ccbc3..2af53dc 100644 --- a/manifests/profile/pacemaker/neutron.pp +++ b/manifests/profile/pacemaker/neutron.pp @@ -61,9 +61,12 @@ class tripleo::profile::pacemaker::neutron ( stop => '/bin/true', } + class { '::tripleo::profile::base::neutron': + sync_db => ($::hostname == downcase($pacemaker_master)), + } + if $step >= 4 { include ::neutron::params - include ::tripleo::profile::base::neutron # To be removed when puppet-oslo comes into service neutron_config { diff --git a/manifests/profile/pacemaker/neutron/ml2.pp b/manifests/profile/pacemaker/neutron/ml2.pp index 6c6e580..8acaf21 100644 --- a/manifests/profile/pacemaker/neutron/ml2.pp +++ b/manifests/profile/pacemaker/neutron/ml2.pp @@ -18,8 +18,19 @@ # # === Parameters # -class tripleo::profile::pacemaker::neutron::ml2 { +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::ml2 ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + include ::neutron::params include ::tripleo::profile::pacemaker::neutron - include ::tripleo::profile::base::neutron::ml2 + + class { '::tripleo::profile::base::neutron::ml2': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + } diff --git a/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp new file mode 100644 index 0000000..1f2b32a --- /dev/null +++ b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp @@ -0,0 +1,33 @@ +# Copyright 2016 PLUMgrid, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::neutron::plugins::plumgrid +# +# PLUMgrid Neutron profile for tripleo pacemaker +# +# === Parameters +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::plugins::plumgrid ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + class { '::tripleo::profile::base::neutron::plugins::plumgrid': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + +} diff --git a/manifests/profile/pacemaker/neutron/server.pp b/manifests/profile/pacemaker/neutron/server.pp index f4fe083..0bad1b9 100644 --- a/manifests/profile/pacemaker/neutron/server.pp +++ b/manifests/profile/pacemaker/neutron/server.pp @@ -23,21 +23,27 @@ # Defaults to hiera('bootstrap_nodeid') # # [*step*] -# (Optional) The current step in deployment. See tripleo-heat-templates -# for more details. -# Defaults to hiera('step') +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') # class tripleo::profile::pacemaker::neutron::server ( $pacemaker_master = hiera('bootstrap_nodeid'), - $step = hiera('step'), + $step = hiera('step'), ) { + include ::neutron::params include ::tripleo::profile::pacemaker::neutron - if $step >= 5 { - class { '::tripleo::profile::base::neutron::server': - sync_db => ($::hostname == downcase($pacemaker_master)), - } + $sync_db = ($::hostname == downcase($pacemaker_master)) + if $step >= 2 and $sync_db { + include ::neutron::db::mysql + Exec<| title == 'galera-ready'|> -> Class['neutron::db::mysql'] + } + + if $step >= 4 or ( $step >= 3 and $sync_db ) { + include ::neutron::server::notifications + include ::neutron::server } } diff --git a/manifests/profile/pacemaker/nova.pp b/manifests/profile/pacemaker/nova.pp index 09aed61..b6e6cba 100644 --- a/manifests/profile/pacemaker/nova.pp +++ b/manifests/profile/pacemaker/nova.pp @@ -35,8 +35,6 @@ class tripleo::profile::pacemaker::nova ( stop => '/bin/true', } - if $step >= 4 { - include ::tripleo::profile::base::nova - } + include ::tripleo::profile::base::nova } diff --git a/manifests/profile/pacemaker/nova/api.pp b/manifests/profile/pacemaker/nova/api.pp new file mode 100644 index 0000000..5d8e11f --- /dev/null +++ b/manifests/profile/pacemaker/nova/api.pp @@ -0,0 +1,48 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::nova::api +# +# Nova API with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to downcase(hiera('bootstrap_nodeid')) +# +class tripleo::profile::pacemaker::nova::api ( + $step = hiera('step'), + $pacemaker_master = downcase(hiera('bootstrap_nodeid')), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + + class { '::tripleo::profile::base::nova::api': + sync_db => (downcase($::hostname) == $pacemaker_master), + } + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::api_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/consoleauth.pp b/manifests/profile/pacemaker/nova/consoleauth.pp new file mode 100644 index 0000000..54f17b7 --- /dev/null +++ b/manifests/profile/pacemaker/nova/consoleauth.pp @@ -0,0 +1,45 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::nova::consoleauth +# +# Nova Consoleauth with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::consoleauth ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::consoleauth + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::consoleauth_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/scheduler.pp b/manifests/profile/pacemaker/nova/scheduler.pp new file mode 100644 index 0000000..6516394 --- /dev/null +++ b/manifests/profile/pacemaker/nova/scheduler.pp @@ -0,0 +1,45 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::nova::scheduler +# +# Nova Scheduler with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::scheduler ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::scheduler + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::scheduler_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/vncproxy.pp b/manifests/profile/pacemaker/nova/vncproxy.pp new file mode 100644 index 0000000..7f7d095 --- /dev/null +++ b/manifests/profile/pacemaker/nova/vncproxy.pp @@ -0,0 +1,45 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::pacemaker::nova::vncproxy +# +# Nova vncproxy with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::vncproxy ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::vncproxy + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::vncproxy_service_name: + clone_params => 'interleave=true', + } + } + +} |