diff options
Diffstat (limited to 'manifests/profile/pacemaker')
49 files changed, 1166 insertions, 482 deletions
diff --git a/manifests/profile/pacemaker/apache.pp b/manifests/profile/pacemaker/apache.pp new file mode 100644 index 0000000..980b3a4 --- /dev/null +++ b/manifests/profile/pacemaker/apache.pp @@ -0,0 +1,57 @@ +# 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::apache +# +# Apache Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::apache ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + if $step >= 5 and $pacemaker_master { + include ::apache::params + pacemaker::resource::service { $::apache::params::service_name: + clone_params => 'interleave=true', + verify_on_create => true, + } + pacemaker::constraint::base { 'openstack-core-then-httpd-constraint': + constraint_type => 'order', + first_resource => 'openstack-core-clone', + second_resource => "${::apache::params::service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::apache::params::service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + } + +} diff --git a/manifests/profile/pacemaker/ceilometer.pp b/manifests/profile/pacemaker/ceilometer.pp index 0c21807..a31128d 100644 --- a/manifests/profile/pacemaker/ceilometer.pp +++ b/manifests/profile/pacemaker/ceilometer.pp @@ -27,47 +27,17 @@ # for more details. # Defaults to hiera('step') # -# [*sync_db*] -# (Optional) Whether to run db sync -# Defaults to undef -# class tripleo::profile::pacemaker::ceilometer ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), - $sync_db = true, ) { - - if $::hostname == downcase($bootstrap_node) { - $pacemaker_master = true - } else { - $pacemaker_master = false - } - include ::tripleo::profile::base::ceilometer - if $step >= 5 and $pacemaker_master { - $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) - case $ceilometer_backend { - /mysql/: { - pacemaker::resource::service { $::ceilometer::params::agent_central_service_name: - clone_params => 'interleave=true', - require => Pacemaker::Resource::Ocf['openstack-core'], - } - } - default: { - pacemaker::resource::service { $::ceilometer::params::agent_central_service_name: - clone_params => 'interleave=true', - require => [Pacemaker::Resource::Ocf['openstack-core'], - Pacemaker::Resource::Service[$::mongodb::params::service_name]], - } - } - } - - if $sync_db { - if $ceilometer_backend == 'mysql' { - class { '::ceilometer::db::mysql': - require => Exec['galera-ready'], - } + $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) + if $step >= 5 and $::hostname == downcase($bootstrap_node) { + if $ceilometer_backend == 'mysql' { + class { '::ceilometer::db::mysql': + require => Exec['galera-ready'], } } @@ -117,22 +87,6 @@ class tripleo::profile::pacemaker::ceilometer ( require => [Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name], Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name]], } - pacemaker::constraint::base { 'ceilometer-collector-then-ceilometer-api-constraint': - constraint_type => 'order', - first_resource => "${::ceilometer::params::collector_service_name}-clone", - second_resource => "${::ceilometer::params::api_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name], - Pacemaker::Resource::Service[$::ceilometer::params::api_service_name]], - } - pacemaker::constraint::colocation { 'ceilometer-api-with-ceilometer-collector-colocation': - source => "${::ceilometer::params::api_service_name}-clone", - target => "${::ceilometer::params::collector_service_name}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::ceilometer::params::api_service_name], - Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name]], - } } } diff --git a/manifests/profile/pacemaker/ceilometer/agent/central.pp b/manifests/profile/pacemaker/ceilometer/agent/central.pp index e227614..90266be 100644 --- a/manifests/profile/pacemaker/ceilometer/agent/central.pp +++ b/manifests/profile/pacemaker/ceilometer/agent/central.pp @@ -31,7 +31,6 @@ class tripleo::profile::pacemaker::ceilometer::agent::central ( $pacemaker_master = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - include ::ceilometer::params include ::tripleo::profile::pacemaker::ceilometer include ::tripleo::profile::base::ceilometer::agent::central diff --git a/manifests/profile/pacemaker/ceilometer/agent/notification.pp b/manifests/profile/pacemaker/ceilometer/agent/notification.pp index 868bb22..e419356 100644 --- a/manifests/profile/pacemaker/ceilometer/agent/notification.pp +++ b/manifests/profile/pacemaker/ceilometer/agent/notification.pp @@ -31,7 +31,6 @@ class tripleo::profile::pacemaker::ceilometer::agent::notification ( $pacemaker_master = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - include ::ceilometer::params include ::tripleo::profile::pacemaker::ceilometer include ::tripleo::profile::base::ceilometer::agent::notification diff --git a/manifests/profile/pacemaker/ceilometer/api.pp b/manifests/profile/pacemaker/ceilometer/api.pp index cfe103a..169121b 100644 --- a/manifests/profile/pacemaker/ceilometer/api.pp +++ b/manifests/profile/pacemaker/ceilometer/api.pp @@ -31,21 +31,14 @@ class tripleo::profile::pacemaker::ceilometer::api ( $pacemaker_master = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - include ::ceilometer::params include ::tripleo::profile::pacemaker::ceilometer include ::tripleo::profile::base::ceilometer::api + include ::tripleo::profile::pacemaker::apache if $step >= 5 and downcase($::hostname) == $pacemaker_master { - pacemaker::resource::service { $::ceilometer::params::api_service_name : - clone_params => 'interleave=true', - } - pacemaker::constraint::colocation { 'ceilometer-delay-with-ceilometer-api-colocation': - source => 'delay-clone', - target => "${::ceilometer::params::api_service_name}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::ceilometer::params::api_service_name], - Pacemaker::Resource::Ocf['delay']], + class { '::tripleo::profile::base::ceilometer::api': + step => $step, } } diff --git a/manifests/profile/pacemaker/ceilometer/collector.pp b/manifests/profile/pacemaker/ceilometer/collector.pp index 2a838f2..d0f7217 100644 --- a/manifests/profile/pacemaker/ceilometer/collector.pp +++ b/manifests/profile/pacemaker/ceilometer/collector.pp @@ -27,22 +27,13 @@ # for more details. # Defaults to hiera('step') # -# [*sync_db*] -# (Optional) Whether to run db sync -# Defaults to undef -# class tripleo::profile::pacemaker::ceilometer::collector ( $pacemaker_master = hiera('bootstrap_nodeid'), $step = hiera('step'), - $sync_db = true, ) { - include ::ceilometer::params include ::tripleo::profile::pacemaker::ceilometer - - class { '::tripleo::profile::base::ceilometer::collector': - sync_db => (downcase($::hostname) == $pacemaker_master), - } + include ::tripleo::profile::base::ceilometer::collector if $step >= 5 and downcase($::hostname) == $pacemaker_master { $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) diff --git a/manifests/profile/pacemaker/cinder/api.pp b/manifests/profile/pacemaker/cinder/api.pp index 2c9cedf..d18942d 100644 --- a/manifests/profile/pacemaker/cinder/api.pp +++ b/manifests/profile/pacemaker/cinder/api.pp @@ -31,7 +31,6 @@ class tripleo::profile::pacemaker::cinder::api ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - Service <| tag == 'cinder-service' |> { hasrestart => true, restart => '/bin/true', @@ -45,9 +44,7 @@ class tripleo::profile::pacemaker::cinder::api ( $pacemaker_master = false } - class { '::tripleo::profile::base::cinder::api': - sync_db => $pacemaker_master, - } + include ::tripleo::profile::base::cinder::api if $step >= 5 and $pacemaker_master { pacemaker::resource::service { $::cinder::params::api_service : diff --git a/manifests/profile/pacemaker/cinder/backup.pp b/manifests/profile/pacemaker/cinder/backup.pp new file mode 100644 index 0000000..20a0104 --- /dev/null +++ b/manifests/profile/pacemaker/cinder/backup.pp @@ -0,0 +1,54 @@ +# 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::cinder::backup +# +# Cinder Backup Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::cinder::backup ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + Service <| tag == 'cinder::backup' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::base::cinder::backup + + if $step >= 5 and $pacemaker_master { + pacemaker::resource::service { $::cinder::params::backup_service : } + } + +} diff --git a/manifests/profile/pacemaker/cinder/scheduler.pp b/manifests/profile/pacemaker/cinder/scheduler.pp index 9b79903..e25ef54 100644 --- a/manifests/profile/pacemaker/cinder/scheduler.pp +++ b/manifests/profile/pacemaker/cinder/scheduler.pp @@ -31,7 +31,6 @@ class tripleo::profile::pacemaker::cinder::scheduler ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - Service <| tag == 'cinder-service' |> { hasrestart => true, restart => '/bin/true', @@ -67,6 +66,22 @@ class tripleo::profile::pacemaker::cinder::scheduler ( require => [Pacemaker::Resource::Service[$::cinder::params::api_service], Pacemaker::Resource::Service[$::cinder::params::scheduler_service]], } + pacemaker::constraint::base { 'cinder-scheduler-then-cinder-volume-constraint': + constraint_type => 'order', + first_resource => "${::cinder::params::scheduler_service}-clone", + second_resource => $::cinder::params::volume_service, + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::cinder::params::scheduler_service], + Pacemaker::Resource::Service[$::cinder::params::volume_service]], + } + pacemaker::constraint::colocation { 'cinder-volume-with-cinder-scheduler-colocation': + source => $::cinder::params::volume_service, + target => "${::cinder::params::scheduler_service}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::cinder::params::scheduler_service], + Pacemaker::Resource::Service[$::cinder::params::volume_service]], + } } } diff --git a/manifests/profile/pacemaker/cinder/volume.pp b/manifests/profile/pacemaker/cinder/volume.pp index a4f251e..5a581eb 100644 --- a/manifests/profile/pacemaker/cinder/volume.pp +++ b/manifests/profile/pacemaker/cinder/volume.pp @@ -31,8 +31,7 @@ class tripleo::profile::pacemaker::cinder::volume ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - - Service <| tag == 'cinder-service' |> { + Service <| tag == 'cinder::volume' |> { hasrestart => true, restart => '/bin/true', start => '/bin/true', @@ -49,22 +48,6 @@ class tripleo::profile::pacemaker::cinder::volume ( if $step >= 5 and $pacemaker_master { pacemaker::resource::service { $::cinder::params::volume_service : } - pacemaker::constraint::base { 'cinder-scheduler-then-cinder-volume-constraint': - constraint_type => 'order', - first_resource => "${::cinder::params::scheduler_service}-clone", - second_resource => $::cinder::params::volume_service, - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::cinder::params::scheduler_service], - Pacemaker::Resource::Service[$::cinder::params::volume_service]], - } - pacemaker::constraint::colocation { 'cinder-volume-with-cinder-scheduler-colocation': - source => $::cinder::params::volume_service, - target => "${::cinder::params::scheduler_service}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::cinder::params::scheduler_service], - Pacemaker::Resource::Service[$::cinder::params::volume_service]], - } } } diff --git a/manifests/profile/pacemaker/core.pp b/manifests/profile/pacemaker/core.pp new file mode 100644 index 0000000..359a817 --- /dev/null +++ b/manifests/profile/pacemaker/core.pp @@ -0,0 +1,58 @@ +# 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::core +# +# Core Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::core ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + if $step >= 2 and $pacemaker_master { + pacemaker::resource::ocf { 'openstack-core': + ocf_agent_name => 'heartbeat:Dummy', + clone_params => 'interleave=true', + } + } + + if $step >= 5 and $pacemaker_master { + pacemaker::constraint::base { 'galera-then-openstack-core-constraint': + constraint_type => 'order', + first_resource => 'galera-master', + second_resource => 'openstack-core-clone', + first_action => 'promote', + second_action => 'start', + require => [Pacemaker::Resource::Ocf['galera'], + Pacemaker::Resource::Ocf['openstack-core']], + } + } +} diff --git a/manifests/profile/pacemaker/database/mongodb.pp b/manifests/profile/pacemaker/database/mongodb.pp index 15c84d7..e4b5fcf 100644 --- a/manifests/profile/pacemaker/database/mongodb.pp +++ b/manifests/profile/pacemaker/database/mongodb.pp @@ -32,10 +32,9 @@ # class tripleo::profile::pacemaker::database::mongodb ( $mongodb_replset, - $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), ) { - if $step >= 1 { include ::mongodb::globals include ::mongodb::client diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp new file mode 100644 index 0000000..31d7d80 --- /dev/null +++ b/manifests/profile/pacemaker/database/mysql.pp @@ -0,0 +1,172 @@ +# 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::mysql +# +# MySQL with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::pacemaker::database::mysql ( + $step = hiera('step'), +) { + if $::hostname == downcase(hiera('bootstrap_nodeid')) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + $mysql_bind_host = hiera('mysql_bind_host') + $galera_nodes = downcase(hiera('galera_node_names', $::hostname)) + $galera_nodes_count = count(split($galera_nodes, ',')) + $mysqld_options = { + 'mysqld' => { + 'skip-name-resolve' => '1', + 'binlog_format' => 'ROW', + 'default-storage-engine' => 'innodb', + 'innodb_autoinc_lock_mode' => '2', + 'innodb_locks_unsafe_for_binlog'=> '1', + 'query_cache_size' => '0', + 'query_cache_type' => '0', + 'bind-address' => $::hostname, + 'max_connections' => hiera('mysql_max_connections'), + 'open_files_limit' => '-1', + 'wsrep_on' => 'ON', + 'wsrep_provider' => '/usr/lib64/galera/libgalera_smm.so', + 'wsrep_cluster_name' => 'galera_cluster', + 'wsrep_cluster_address' => "gcomm://${galera_nodes}", + 'wsrep_slave_threads' => '1', + 'wsrep_certify_nonPK' => '1', + 'wsrep_max_ws_rows' => '131072', + 'wsrep_max_ws_size' => '1073741824', + 'wsrep_debug' => '0', + 'wsrep_convert_LOCK_to_trx' => '0', + 'wsrep_retry_autocommit' => '1', + 'wsrep_auto_increment_control' => '1', + 'wsrep_drupal_282555_workaround'=> '0', + 'wsrep_causal_reads' => '0', + 'wsrep_sst_method' => 'rsync', + 'wsrep_provider_options' => "gmcast.listen_addr=tcp://[${mysql_bind_host}]:4567;", + } + } + + class { '::tripleo::profile::base::database::mysql': + manage_resources => false, + remove_default_accounts => $pacemaker_master, + mysql_server_options => $mysqld_options, + } + + if $step >= 2 { + if $pacemaker_master { + pacemaker::resource::ocf { 'galera' : + ocf_agent_name => 'heartbeat:galera', + op_params => 'promote timeout=300s on-fail=block', + master_params => '', + meta_params => "master-max=${galera_nodes_count} ordered=true", + resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'", + require => Class['::mysql::server'], + before => Exec['galera-ready'], + } + exec { 'galera-ready' : + command => '/usr/bin/clustercheck >/dev/null', + timeout => 30, + tries => 180, + try_sleep => 10, + environment => ['AVAILABLE_WHEN_READONLY=0'], + require => Exec['create-root-sysconfig-clustercheck'], + } + # We add a clustercheck db user and we will switch /etc/sysconfig/clustercheck + # to it in a later step. We do this only on one node as it will replicate on + # the other members. We also make sure that the permissions are the minimum necessary + mysql_user { 'clustercheck@localhost': + ensure => 'present', + password_hash => mysql_password(hiera('mysql_clustercheck_password')), + require => Exec['galera-ready'], + } + mysql_grant { 'clustercheck@localhost/*.*': + ensure => 'present', + options => ['GRANT'], + privileges => ['PROCESS'], + table => '*.*', + user => 'clustercheck@localhost', + } + } + # This step is to create a sysconfig clustercheck file with the root user and empty password + # on the first install only (because later on the clustercheck db user will be used) + # We are using exec and not file in order to not have duplicate definition errors in puppet + # when we later set the the file to contain the clustercheck data + exec { 'create-root-sysconfig-clustercheck': + command => "/bin/echo 'MYSQL_USERNAME=root\nMYSQL_PASSWORD=\'\'\nMYSQL_HOST=localhost\n' > /etc/sysconfig/clustercheck", + unless => '/bin/test -e /etc/sysconfig/clustercheck && grep -q clustercheck /etc/sysconfig/clustercheck', + } + xinetd::service { 'galera-monitor' : + port => '9200', + server => '/usr/bin/clustercheck', + per_source => 'UNLIMITED', + log_on_success => '', + log_on_failure => 'HOST', + flags => 'REUSE', + service_type => 'UNLISTED', + user => 'root', + group => 'root', + require => Exec['create-root-sysconfig-clustercheck'], + } + } + + if $step >= 4 or ( $step >= 3 and $pacemaker_master ) { + # At this stage we are guaranteed that the clustercheck db user exists + # so we switch the resource agent to use it. + $mysql_clustercheck_password = hiera('mysql_clustercheck_password') + file { '/etc/sysconfig/clustercheck' : + ensure => file, + mode => '0600', + owner => 'root', + group => 'root', + content => "MYSQL_USERNAME=clustercheck\n +MYSQL_PASSWORD='${mysql_clustercheck_password}'\n +MYSQL_HOST=localhost\n", + } + } + + if $step >= 5 { + # We now make sure that the root db password is set to a random one + # At first installation /root/.my.cnf will be empty and we connect without a root + # password. On second runs or updates /root/.my.cnf will already be populated + # with proper credentials. This step happens on every node because this sql + # statement does not automatically replicate across nodes. + $mysql_root_password = hiera('mysql::server::root_password') + exec { 'galera-set-root-password': + command => "/bin/touch /root/.my.cnf && /bin/echo \"UPDATE mysql.user SET Password = PASSWORD('${mysql_root_password}') WHERE user = 'root'; flush privileges;\" | /bin/mysql --defaults-extra-file=/root/.my.cnf -u root", + } + file { '/root/.my.cnf' : + ensure => file, + mode => '0600', + owner => 'root', + group => 'root', + content => "[client] + user=root + password=\"${mysql_root_password}\" + + [mysql] + user=root + password=\"${mysql_root_password}\"", + require => Exec['galera-set-root-password'], + } + } + +} diff --git a/manifests/profile/pacemaker/database/redis.pp b/manifests/profile/pacemaker/database/redis.pp index 9bb96ae..8a37ce9 100644 --- a/manifests/profile/pacemaker/database/redis.pp +++ b/manifests/profile/pacemaker/database/redis.pp @@ -18,9 +18,6 @@ # # === Parameters # -# [*redis_vip*] -# Redis virtual IP -# # [*bootstrap_node*] # (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') @@ -34,9 +31,7 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::pacemaker::database::redis ( - $redis_vip, $bootstrap_node = hiera('bootstrap_nodeid'), $enable_load_balancer = hiera('enable_load_balancer', true), $step = hiera('step'), diff --git a/manifests/profile/pacemaker/glance.pp b/manifests/profile/pacemaker/glance.pp index 10f4f03..664b91f 100644 --- a/manifests/profile/pacemaker/glance.pp +++ b/manifests/profile/pacemaker/glance.pp @@ -22,19 +22,10 @@ # (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') -# # [*glance_backend*] # (Optional) Glance backend(s) to use. # Defaults to downcase(hiera('glance_backend', 'swift')) # -# [*glance_file_pcmk_manage*] -# (Optional) Whether or not manage glance_file_pcmk. -# Defaults to hiera('glance_file_pcmk_manage', false) -# # [*glance_file_pcmk_device*] # (Optional) Device to mount glance file backend. # Defaults to hiera('glance_file_pcmk_device', '') @@ -47,21 +38,29 @@ # (Optional) Filesystem type to mount glance file backend. # Defaults to hiera('glance_file_pcmk_fstype', '') # +# [*glance_file_pcmk_manage*] +# (Optional) Whether or not manage glance_file_pcmk. +# Defaults to hiera('glance_file_pcmk_manage', false) +# # [*glance_file_pcmk_options*] # (Optional) pcmk options to mount Glance file backend.. # Defaults to hiera('glance_file_pcmk_options', '') # +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# class tripleo::profile::pacemaker::glance ( $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), $glance_backend = downcase(hiera('glance_backend', 'swift')), - $glance_file_pcmk_manage = hiera('glance_file_pcmk_manage', false), $glance_file_pcmk_device = hiera('glance_file_pcmk_device', ''), $glance_file_pcmk_directory = hiera('glance_file_pcmk_directory', ''), $glance_file_pcmk_fstype = hiera('glance_file_pcmk_fstype', ''), + $glance_file_pcmk_manage = hiera('glance_file_pcmk_manage', false), $glance_file_pcmk_options = hiera('glance_file_pcmk_options', ''), + $step = hiera('step'), ) { - Service <| tag == 'glance-service' |> { hasrestart => true, restart => '/bin/true', @@ -76,9 +75,7 @@ class tripleo::profile::pacemaker::glance ( } include ::tripleo::profile::base::glance::api - class { '::tripleo::profile::base::glance::registry': - sync_db => $pacemaker_master, - } + include ::tripleo::profile::base::glance::registry if $step >= 4 { if $glance_backend == 'file' and $glance_file_pcmk_manage { diff --git a/manifests/profile/pacemaker/gnocchi.pp b/manifests/profile/pacemaker/gnocchi.pp new file mode 100644 index 0000000..5bfc174 --- /dev/null +++ b/manifests/profile/pacemaker/gnocchi.pp @@ -0,0 +1,97 @@ +# 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::gnocchi +# +# Gnocchi Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# +# [*gnocchi_indexer_backend*] +# (Optional) Gnocchi indexer backend +# Defaults to mysql +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::pacemaker::gnocchi ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $gnocchi_indexer_backend = downcase(hiera('gnocchi_indexer_backend', 'mysql')), + $step = hiera('step'), +) { + Service <| tag == 'gnocchi-service' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + if $step >= 2 and $pacemaker_master { + if $gnocchi_indexer_backend == 'mysql' { + class { '::gnocchi::db::mysql': + require => Exec['galera-ready'], + } + } + } + + if $step >= 3 { + include ::gnocchi + include ::gnocchi::config + include ::gnocchi::client + if $pacemaker_master { + include ::gnocchi::db::sync + } + } + + if $step >= 5 and $pacemaker_master { + + pacemaker::constraint::base { 'keystone-then-gnocchi-metricd-constraint': + constraint_type => 'order', + first_resource => 'openstack-core-clone', + second_resource => "${::gnocchi::params::metricd_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::gnocchi::params::metricd_service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + pacemaker::constraint::base { 'gnocchi-metricd-then-gnocchi-statsd-constraint': + constraint_type => 'order', + first_resource => "${::gnocchi::params::metricd_service_name}-clone", + second_resource => "${::gnocchi::params::statsd_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::gnocchi::params::metricd_service_name], + Pacemaker::Resource::Service[$::gnocchi::params::statsd_service_name]], + } + pacemaker::constraint::colocation { 'gnocchi-statsd-with-metricd-colocation': + source => "${::gnocchi::params::statsd_service_name}-clone", + target => "${::gnocchi::params::metricd_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::gnocchi::params::metricd_service_name], + Pacemaker::Resource::Service[$::gnocchi::params::statsd_service_name]], + } + } +} diff --git a/manifests/profile/pacemaker/gnocchi/api.pp b/manifests/profile/pacemaker/gnocchi/api.pp new file mode 100644 index 0000000..29f2435 --- /dev/null +++ b/manifests/profile/pacemaker/gnocchi/api.pp @@ -0,0 +1,32 @@ +# 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::gnocchi::api +# +# Gnocchi profile for tripleo api +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::pacemaker::gnocchi::api ( + $step = hiera('step'), +) { + include ::tripleo::profile::pacemaker::gnocchi + include ::tripleo::profile::pacemaker::apache + include ::tripleo::profile::base::gnocchi::api +} diff --git a/manifests/profile/pacemaker/gnocchi/metricd.pp b/manifests/profile/pacemaker/gnocchi/metricd.pp new file mode 100644 index 0000000..c9dc2d9 --- /dev/null +++ b/manifests/profile/pacemaker/gnocchi/metricd.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::gnocchi::metricd +# +# Gnocchi metricd profile +# +# === Parameters +# +# [*pacemaker_master*] +# (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::gnocchi::metricd ( + $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + include ::gnocchi::params + include ::tripleo::profile::pacemaker::gnocchi + + if $step >= 4 and downcase($::hostname) == $pacemaker_master { + + include ::gnocchi::metricd + + pacemaker::resource::service { $::gnocchi::params::metricd_service_name : + clone_params => 'interleave=true', + } + } +} diff --git a/manifests/profile/pacemaker/neutron/ml2.pp b/manifests/profile/pacemaker/gnocchi/statsd.pp index ab5a219..42d30b9 100644 --- a/manifests/profile/pacemaker/neutron/ml2.pp +++ b/manifests/profile/pacemaker/gnocchi/statsd.pp @@ -12,27 +12,34 @@ # License for the specific language governing permissions and limitations # under the License. # -# == Class: tripleo::profile::pacemaker::neutron::ml2 +# == Class: tripleo::profile::pacemaker::gnocchi::statsd # -# Neutron ML2 driver Pacemaker HA profile for tripleo +# Gnocchi statsd profile # # === Parameters # # [*pacemaker_master*] -# (Optional) The hostname of the pacemaker master +# (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') # -class tripleo::profile::pacemaker::neutron::ml2 ( +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::pacemaker::gnocchi::statsd ( $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), ) { + include ::gnocchi::params + include ::tripleo::profile::pacemaker::gnocchi - warning('This class is going is deprecated and will be removed very soon, replaced by tripleo::profile::pacemaker::neutron::plugins::ml2.') + if $step >= 4 and downcase($::hostname) == $pacemaker_master { - include ::neutron::params - include ::tripleo::profile::pacemaker::neutron + include ::gnocchi::statsd - class { '::tripleo::profile::base::neutron::plugins::ml2': - sync_db => ($::hostname == downcase($pacemaker_master)) + pacemaker::resource::service { $::gnocchi::params::statsd_service_name : + clone_params => 'interleave=true', + } } - } diff --git a/manifests/profile/pacemaker/haproxy.pp b/manifests/profile/pacemaker/haproxy.pp index a7aca58..1b83d9b 100644 --- a/manifests/profile/pacemaker/haproxy.pp +++ b/manifests/profile/pacemaker/haproxy.pp @@ -22,21 +22,20 @@ # (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') # +# [*enable_load_balancer*] +# (Optional) Whether load balancing is enabled for this cluster +# Defaults to hiera('enable_load_balancer', true) +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # -# [*enable_load_balancer*] -# (Optional) Whether load balancing is enabled for this cluster -# Defaults to hiera('enable_load_balancer', true) -# class tripleo::profile::pacemaker::haproxy ( $bootstrap_node = hiera('bootstrap_nodeid'), + $enable_load_balancer = hiera('enable_load_balancer', true), $step = hiera('step'), - $enable_load_balancer = hiera('enable_load_balancer', true) ) { - include ::tripleo::profile::base::haproxy if $::hostname == downcase($bootstrap_node) { diff --git a/manifests/profile/pacemaker/heat.pp b/manifests/profile/pacemaker/heat.pp index 001b36f..e3c1598 100644 --- a/manifests/profile/pacemaker/heat.pp +++ b/manifests/profile/pacemaker/heat.pp @@ -18,20 +18,14 @@ # # === Parameters # -# [*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::heat ( - $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), + $step = hiera('step'), ) { - Service <| tag == 'heat-service' |> { hasrestart => true, restart => '/bin/true', @@ -39,94 +33,6 @@ class tripleo::profile::pacemaker::heat ( stop => '/bin/true', } - if $::hostname == downcase($bootstrap_node) { - $pacemaker_master = true - } else { - $pacemaker_master = false - } - - class { '::tripleo::profile::base::heat': - bootstrap_master => $bootstrap_node, - } - include ::tripleo::profile::base::heat::api - include ::tripleo::profile::base::heat::api_cfn - include ::tripleo::profile::base::heat::api_cloudwatch - class { '::tripleo::profile::base::heat::engine': - sync_db => $pacemaker_master, - } - - if $step >= 5 and $pacemaker_master { - # Heat - pacemaker::resource::service { $::heat::params::api_service_name : - clone_params => 'interleave=true', - } - pacemaker::resource::service { $::heat::params::api_cloudwatch_service_name : - clone_params => 'interleave=true', - } - pacemaker::resource::service { $::heat::params::api_cfn_service_name : - clone_params => 'interleave=true', - } - pacemaker::resource::service { $::heat::params::engine_service_name : - clone_params => 'interleave=true', - } - pacemaker::constraint::base { 'heat-api-then-heat-api-cfn-constraint': - constraint_type => 'order', - first_resource => "${::heat::params::api_service_name}-clone", - second_resource => "${::heat::params::api_cfn_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::heat::params::api_service_name], - Pacemaker::Resource::Service[$::heat::params::api_cfn_service_name]], - } - pacemaker::constraint::colocation { 'heat-api-cfn-with-heat-api-colocation': - source => "${::heat::params::api_cfn_service_name}-clone", - target => "${::heat::params::api_service_name}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::heat::params::api_cfn_service_name], - Pacemaker::Resource::Service[$::heat::params::api_service_name]], - } - pacemaker::constraint::base { 'heat-api-cfn-then-heat-api-cloudwatch-constraint': - constraint_type => 'order', - first_resource => "${::heat::params::api_cfn_service_name}-clone", - second_resource => "${::heat::params::api_cloudwatch_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::heat::params::api_cloudwatch_service_name], - Pacemaker::Resource::Service[$::heat::params::api_cfn_service_name]], - } - pacemaker::constraint::colocation { 'heat-api-cloudwatch-with-heat-api-cfn-colocation': - source => "${::heat::params::api_cloudwatch_service_name}-clone", - target => "${::heat::params::api_cfn_service_name}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::heat::params::api_cfn_service_name], - Pacemaker::Resource::Service[$::heat::params::api_cloudwatch_service_name]], - } - pacemaker::constraint::base { 'heat-api-cloudwatch-then-heat-engine-constraint': - constraint_type => 'order', - first_resource => "${::heat::params::api_cloudwatch_service_name}-clone", - second_resource => "${::heat::params::engine_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::heat::params::api_cloudwatch_service_name], - Pacemaker::Resource::Service[$::heat::params::engine_service_name]], - } - pacemaker::constraint::colocation { 'heat-engine-with-heat-api-cloudwatch-colocation': - source => "${::heat::params::engine_service_name}-clone", - target => "${::heat::params::api_cloudwatch_service_name}-clone", - score => 'INFINITY', - require => [Pacemaker::Resource::Service[$::heat::params::api_cloudwatch_service_name], - Pacemaker::Resource::Service[$::heat::params::engine_service_name]], - } - pacemaker::constraint::base { 'ceilometer-notification-then-heat-api-constraint': - constraint_type => 'order', - first_resource => "${::ceilometer::params::agent_notification_service_name}-clone", - second_resource => "${::heat::params::api_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::heat::params::api_service_name], - Pacemaker::Resource::Service[$::ceilometer::params::agent_notification_service_name]], - } - - } + include ::tripleo::profile::base::heat } diff --git a/manifests/profile/pacemaker/heat/api.pp b/manifests/profile/pacemaker/heat/api.pp new file mode 100644 index 0000000..0fc4f8a --- /dev/null +++ b/manifests/profile/pacemaker/heat/api.pp @@ -0,0 +1,49 @@ +# 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::heat +# +# Heat API Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::heat::api ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::heat + include ::tripleo::profile::base::heat::api + + if $step >= 5 and $pacemaker_master { + pacemaker::resource::service { $::heat::params::api_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/heat/api_cfn.pp b/manifests/profile/pacemaker/heat/api_cfn.pp new file mode 100644 index 0000000..1230c6b --- /dev/null +++ b/manifests/profile/pacemaker/heat/api_cfn.pp @@ -0,0 +1,49 @@ +# 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::heat +# +# Heat Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::heat::api_cfn ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::heat + include ::tripleo::profile::base::heat::api_cfn + + if $step >= 5 and $pacemaker_master { + pacemaker::resource::service { $::heat::params::api_cfn_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/heat/api_cloudwatch.pp b/manifests/profile/pacemaker/heat/api_cloudwatch.pp new file mode 100644 index 0000000..6110a0c --- /dev/null +++ b/manifests/profile/pacemaker/heat/api_cloudwatch.pp @@ -0,0 +1,50 @@ +# 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::heat +# +# Heat Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::heat::api_cloudwatch ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::heat + include ::tripleo::profile::base::heat::api_cloudwatch + + if $step >= 5 and $pacemaker_master { + # Heat + pacemaker::resource::service { $::heat::params::api_cloudwatch_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/heat/engine.pp b/manifests/profile/pacemaker/heat/engine.pp new file mode 100644 index 0000000..88744ad --- /dev/null +++ b/manifests/profile/pacemaker/heat/engine.pp @@ -0,0 +1,49 @@ +# 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::heat +# +# Heat Engine Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::heat::engine ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::heat + include ::tripleo::profile::base::heat::engine + + if $step >= 5 and $pacemaker_master { + pacemaker::resource::service { $::heat::params::engine_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/keystone.pp b/manifests/profile/pacemaker/keystone.pp index 497d6f3..db14aea 100644 --- a/manifests/profile/pacemaker/keystone.pp +++ b/manifests/profile/pacemaker/keystone.pp @@ -22,21 +22,20 @@ # (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') # +# [*enable_load_balancer*] +# (Optional) Whether load balancing is enabled for this cluster +# Defaults to hiera('enable_load_balancer', true) +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # -# [*enable_load_balancer*] -# (Optional) Whether load balancing is enabled for this cluster -# Defaults to hiera('enable_load_balancer', true) -# class tripleo::profile::pacemaker::keystone ( $bootstrap_node = hiera('bootstrap_nodeid'), + $enable_load_balancer = hiera('enable_load_balancer', true), $step = hiera('step'), - $enable_load_balancer = hiera('enable_load_balancer', true) ) { - Service <| tag == 'keystone-service' |> { hasrestart => true, restart => '/bin/true', @@ -50,19 +49,8 @@ class tripleo::profile::pacemaker::keystone ( $pacemaker_master = false } - if $step >= 5 and $pacemaker_master { - $manage_roles = true - Pacemaker::Resource::Service[$::apache::params::service_name] -> Class['::keystone::roles::admin'] - Pacemaker::Resource::Service[$::apache::params::service_name] -> Class['::keystone::endpoint'] - } else { - $manage_roles = false - } - - class { '::tripleo::profile::base::keystone': - sync_db => $pacemaker_master, - manage_roles => $manage_roles, - manage_endpoint => $manage_roles - } + include ::tripleo::profile::base::keystone + include ::tripleo::profile::pacemaker::apache if $step >= 5 and $pacemaker_master and $enable_load_balancer { pacemaker::constraint::base { 'haproxy-then-keystone-constraint': diff --git a/manifests/profile/pacemaker/manila.pp b/manifests/profile/pacemaker/manila.pp index 37cab9f..43ae875 100644 --- a/manifests/profile/pacemaker/manila.pp +++ b/manifests/profile/pacemaker/manila.pp @@ -22,86 +22,85 @@ # (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') +# [*cinder_volume_type*] +# (Optional) +# Defaults to hiera('manila::backend::generic::cinder_volume_type', '') +# +# [*driver_handles_share_servers*] +# (Optional) +# Defaults to hiera('manila::backend::generic::driver_handles_share_servers') # # [*manila_generic_enable*] # (Optional) Enable the generic backend. # Defaults to hiera('manila_generic_enable_backend', 'false') # -# [*driver_handles_share_servers*] +# [*max_time_to_attach*] # (Optional) -# Defaults to hiera('manila::backend::generic::driver_handles_share_servers') +# Defaults to hiera('manila::backend::generic::max_time_to_attach') # -# [*smb_template_config_path*] +# [*max_time_to_create_volume*] # (Optional) -# Defaults to hiera('manila::backend::generic::smb_template_config_path') +# Defaults to hiera('manila::backend::generic::max_time_to_create_volume') # -# [*volume_name_template*] -# (Optional) -# Defaults to hiera('manila::backend::generic::volume_name_template') - -# [*volume_snapshot_name_template*] +# [*service_instance_flavor_id*] # (Optional) -# Defaults to hiera('manila::backend::generic::volume_snapshot_name_template') +# Defaults to hiera('manila::service_instance::service_instance_flavor_id') # -# [*share_mount_path*] +# [*service_instance_password*] # (Optional) -# Defaults to hiera('manila::backend::generic::share_mount_path') +# Defaults to hiera('manila::service_instance::service_instance_password') # -# [*max_time_to_create_volume*] +# [*service_instance_smb_config_path*] # (Optional) -# Defaults to hiera('manila::backend::generic::max_time_to_create_volume') +# Defaults to downcase(hiera('manila::backend::generic::service_instance_smb_config_path')) # -# [*max_time_to_attach*] +# [*service_instance_user*] # (Optional) -# Defaults to hiera('manila::backend::generic::max_time_to_attach') +# Defaults to hiera('manila::service_instance::service_instance_user') # -# [*service_instance_smb_config_path*] +# [*share_mount_path*] # (Optional) -# Defaults to downcase(hiera('manila::backend::generic::service_instance_smb_config_path')) +# Defaults to hiera('manila::backend::generic::share_mount_path') # # [*share_volume_fstype*] # (Optional) # Defaults to hiera('manila::backend::generic::share_volume_fstype') # -# [*cinder_volume_type*] +# [*smb_template_config_path*] # (Optional) -# Defaults to hiera('manila::backend::generic::cinder_volume_type', '') +# Defaults to hiera('manila::backend::generic::smb_template_config_path') # -# [*service_instance_user*] -# (Optional) -# Defaults to hiera('manila::service_instance::service_instance_user') - -# [*service_instance_password*] +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*volume_name_template*] # (Optional) -# Defaults to hiera('manila::service_instance::service_instance_password') - -# [*service_instance_flavor_id*] +# Defaults to hiera('manila::backend::generic::volume_name_template') +# +# [*volume_snapshot_name_template*] # (Optional) -# Defaults to hiera('manila::service_instance::service_instance_flavor_id') +# Defaults to hiera('manila::backend::generic::volume_snapshot_name_template') # class tripleo::profile::pacemaker::manila ( $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), - $manila_generic_enable = hiera('manila_generic_enable_backend', false), + $cinder_volume_type = hiera('manila::backend::generic::cinder_volume_type', ''), $driver_handles_share_servers = hiera('manila::backend::generic::driver_handles_share_servers'), - $smb_template_config_path = hiera('manila::backend::generic::smb_template_config_path'), - $volume_name_template = hiera('manila::backend::generic::volume_name_template'), - $volume_snapshot_name_template = hiera('manila::backend::generic::volume_snapshot_name_template'), - $share_mount_path = hiera('manila::backend::generic::share_mount_path'), - $max_time_to_create_volume = hiera('manila::backend::generic::max_time_to_create_volume'), + $manila_generic_enable = hiera('manila_generic_enable_backend', false), $max_time_to_attach = hiera('manila::backend::generic::max_time_to_attach'), + $max_time_to_create_volume = hiera('manila::backend::generic::max_time_to_create_volume'), + $service_instance_flavor_id = hiera('manila::service_instance::service_instance_flavor_id'), + $service_instance_password = hiera('manila::service_instance::service_instance_password'), $service_instance_smb_config_path = hiera('manila::backend::generic::service_instance_smb_config_path'), - $share_volume_fstype = hiera('manila::backend::generic::share_volume_fstype'), - $cinder_volume_type = hiera('manila::backend::generic::cinder_volume_type', ''), $service_instance_user = hiera('manila::service_instance::service_instance_user'), - $service_instance_password = hiera('manila::service_instance::service_instance_password'), - $service_instance_flavor_id = hiera('manila::service_instance::service_instance_flavor_id'), + $share_mount_path = hiera('manila::backend::generic::share_mount_path'), + $share_volume_fstype = hiera('manila::backend::generic::share_volume_fstype'), + $smb_template_config_path = hiera('manila::backend::generic::smb_template_config_path'), + $step = hiera('step'), + $volume_name_template = hiera('manila::backend::generic::volume_name_template'), + $volume_snapshot_name_template = hiera('manila::backend::generic::volume_snapshot_name_template'), ) { - if $::hostname == downcase($bootstrap_node) { $pacemaker_master = true } else { @@ -122,7 +121,6 @@ class tripleo::profile::pacemaker::manila ( include ::tripleo::profile::base::manila::scheduler include ::tripleo::profile::base::manila::share - $manila_generic_enable = hiera('manila_generic_enable_backend', false) if $manila_generic_enable { $manila_generic_backend = hiera('manila::backend::generic::title') manila::backend::generic { $manila_generic_backend : diff --git a/manifests/profile/pacemaker/memcached.pp b/manifests/profile/pacemaker/memcached.pp index 09af5d6..2a6bd4d 100644 --- a/manifests/profile/pacemaker/memcached.pp +++ b/manifests/profile/pacemaker/memcached.pp @@ -31,7 +31,6 @@ class tripleo::profile::pacemaker::memcached ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), ) { - if $::hostname == downcase($bootstrap_node) { $pacemaker_master = true } else { diff --git a/manifests/profile/pacemaker/neutron.pp b/manifests/profile/pacemaker/neutron.pp index 2af53dc..6525126 100644 --- a/manifests/profile/pacemaker/neutron.pp +++ b/manifests/profile/pacemaker/neutron.pp @@ -18,22 +18,14 @@ # # === Parameters # -# [*step*] -# (Optional) The step in the deployment -# Defaults to hiera('step') -# -# [*pacemaker_master*] -# (Optional) The hostname of the pacemaker master -# Defaults to hiera('bootstrap_nodeid') +# [*enable_dhcp*] +# (Optional) Whether to include the Neutron DHCP agent pacemaker profile +# Defaults to hiera('neutron::enable_dhcp_agent', false) # # [*enable_l3*] # (Optional) Whether to include the Neutron L3 agent pacemaker profile # Defaults to hiera('neutron::enable_l3_agent', false) # -# [*enable_dhcp*] -# (Optional) Whether to include the Neutron DHCP agent pacemaker profile -# Defaults to hiera('neutron::enable_dhcp_agent', false) -# # [*enable_metadata*] # (Optional) Whether to include the Neutron Metadata agent pacemaker profile # Defaults to hiera('neutron::enable_metadata_agent', false) @@ -42,16 +34,24 @@ # (Optional) Whether to include the Neutron OVS agent pacemaker profile # Defaults to hiera('neutron::enable_ovs_agent', false) # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# +# [*step*] +# (Optional) The step in the deployment +# Defaults to hiera('step') +# class tripleo::profile::pacemaker::neutron ( - $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), # We can drop the hiera defaults once the neutron roles are decomposed - $enable_l3 = hiera('neutron::enable_l3_agent', false), $enable_dhcp = hiera('neutron::enable_dhcp_agent', false), + $enable_l3 = hiera('neutron::enable_l3_agent', false), $enable_metadata = hiera('neutron::enable_metadata_agent', false), $enable_ovs = hiera('neutron::enable_ovs_agent', false), + #Don't drop below this line + $pacemaker_master = hiera('bootstrap_nodeid', undef), + $step = hiera('step'), ) { - Service <| tag == 'neutron-service' |> { @@ -61,9 +61,7 @@ class tripleo::profile::pacemaker::neutron ( stop => '/bin/true', } - class { '::tripleo::profile::base::neutron': - sync_db => ($::hostname == downcase($pacemaker_master)), - } + include ::tripleo::profile::base::neutron if $step >= 4 { include ::neutron::params @@ -183,5 +181,31 @@ class tripleo::profile::pacemaker::neutron ( Pacemaker::Resource::Service[$::neutron::params::metadata_agent_service]] } } + + #VSM + if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') { + pacemaker::resource::ocf { 'vsm-p' : + ocf_agent_name => 'heartbeat:VirtualDomain', + resource_params => 'force_stop=true config=/var/spool/cisco/vsm/vsm_primary_deploy.xml', + require => Class['n1k_vsm'], + meta_params => 'resource-stickiness=INFINITY', + } + if str2bool(hiera('n1k_vsm::pacemaker_control', true)) { + pacemaker::resource::ocf { 'vsm-s' : + ocf_agent_name => 'heartbeat:VirtualDomain', + resource_params => 'force_stop=true config=/var/spool/cisco/vsm/vsm_secondary_deploy.xml', + require => Class['n1k_vsm'], + meta_params => 'resource-stickiness=INFINITY', + } + pacemaker::constraint::colocation { 'vsm-colocation-contraint': + source => 'vsm-p', + target => 'vsm-s', + score => '-INFINITY', + require => [Pacemaker::Resource::Ocf['vsm-p'], + Pacemaker::Resource::Ocf['vsm-s']], + } + } + } + } } diff --git a/manifests/profile/pacemaker/neutron/dhcp.pp b/manifests/profile/pacemaker/neutron/dhcp.pp index 1f3b178..e76012f 100644 --- a/manifests/profile/pacemaker/neutron/dhcp.pp +++ b/manifests/profile/pacemaker/neutron/dhcp.pp @@ -18,20 +18,19 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# # [*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::neutron::dhcp ( + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), ) { - include ::neutron::params include ::tripleo::profile::pacemaker::neutron include ::tripleo::profile::base::neutron::dhcp diff --git a/manifests/profile/pacemaker/neutron/l3.pp b/manifests/profile/pacemaker/neutron/l3.pp index e1699cc..c3ae3b8 100644 --- a/manifests/profile/pacemaker/neutron/l3.pp +++ b/manifests/profile/pacemaker/neutron/l3.pp @@ -18,20 +18,19 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# # [*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::neutron::l3 ( + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), ) { - include ::neutron::params include ::tripleo::profile::pacemaker::neutron include ::tripleo::profile::base::neutron::l3 diff --git a/manifests/profile/pacemaker/neutron/metadata.pp b/manifests/profile/pacemaker/neutron/metadata.pp index e6bccb1..f09edba 100644 --- a/manifests/profile/pacemaker/neutron/metadata.pp +++ b/manifests/profile/pacemaker/neutron/metadata.pp @@ -18,20 +18,19 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# # [*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::neutron::metadata ( + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), ) { - include ::neutron::params include ::tripleo::profile::pacemaker::neutron include ::tripleo::profile::base::neutron::metadata diff --git a/manifests/profile/pacemaker/neutron/midonet.pp b/manifests/profile/pacemaker/neutron/midonet.pp index a4ec831..453641a 100644 --- a/manifests/profile/pacemaker/neutron/midonet.pp +++ b/manifests/profile/pacemaker/neutron/midonet.pp @@ -18,18 +18,18 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# # [*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::neutron::midonet ( + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), ) { include ::neutron::params include ::tripleo::profile::pacemaker::neutron diff --git a/manifests/profile/pacemaker/neutron/ovs.pp b/manifests/profile/pacemaker/neutron/ovs.pp index 34ff5d3..7e3b15c 100644 --- a/manifests/profile/pacemaker/neutron/ovs.pp +++ b/manifests/profile/pacemaker/neutron/ovs.pp @@ -18,20 +18,19 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid', undef) +# # [*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::neutron::ovs ( + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), - $pacemaker_master = hiera('bootstrap_nodeid'), ) { - include ::neutron::params include ::tripleo::profile::pacemaker::neutron include ::tripleo::profile::base::neutron::ovs diff --git a/manifests/profile/pacemaker/neutron/plugins/ml2.pp b/manifests/profile/pacemaker/neutron/plugins/ml2.pp index 5ec363b..aff682a 100644 --- a/manifests/profile/pacemaker/neutron/plugins/ml2.pp +++ b/manifests/profile/pacemaker/neutron/plugins/ml2.pp @@ -18,19 +18,9 @@ # # === Parameters # -# [*pacemaker_master*] -# (Optional) The hostname of the pacemaker master -# Defaults to hiera('bootstrap_nodeid') -# -class tripleo::profile::pacemaker::neutron::plugins::ml2 ( - $pacemaker_master = hiera('bootstrap_nodeid'), -) { - +class tripleo::profile::pacemaker::neutron::plugins::ml2 +{ include ::neutron::params include ::tripleo::profile::pacemaker::neutron - - class { '::tripleo::profile::base::neutron::plugins::ml2': - sync_db => ($::hostname == downcase($pacemaker_master)) - } - + include ::tripleo::profile::base::neutron::plugins::ml2 } diff --git a/manifests/profile/pacemaker/neutron/plugins/nuage.pp b/manifests/profile/pacemaker/neutron/plugins/nuage.pp index 6b38884..03cdb7e 100644 --- a/manifests/profile/pacemaker/neutron/plugins/nuage.pp +++ b/manifests/profile/pacemaker/neutron/plugins/nuage.pp @@ -18,16 +18,7 @@ # # === Parameters # -# [*pacemaker_master*] -# (Optional) The hostname of the pacemaker master -# Defaults to hiera('bootstrap_nodeid') -# -class tripleo::profile::pacemaker::neutron::plugins::nuage ( - $pacemaker_master = hiera('bootstrap_nodeid'), -) { - - class { '::tripleo::profile::base::neutron::plugins::nuage': - sync_db => ($::hostname == downcase($pacemaker_master)) - } - +class tripleo::profile::pacemaker::neutron::plugins::nuage +{ + include ::tripleo::profile::base::neutron::plugins::nuage } diff --git a/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp b/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp index 32564f4..438245a 100644 --- a/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp +++ b/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp @@ -18,16 +18,7 @@ # # === Parameters # -# [*pacemaker_master*] -# (Optional) The hostname of the pacemaker master -# Defaults to hiera('bootstrap_nodeid') -# -class tripleo::profile::pacemaker::neutron::plugins::opencontrail ( - $pacemaker_master = hiera('bootstrap_nodeid'), -) { - - class { '::tripleo::profile::base::neutron::plugins::opencontrail': - sync_db => ($::hostname == downcase($pacemaker_master)) - } - +class tripleo::profile::pacemaker::neutron::plugins::opencontrail +{ + include ::tripleo::profile::base::neutron::plugins::opencontrail } diff --git a/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp index 1f2b32a..38b2179 100644 --- a/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp +++ b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp @@ -18,16 +18,7 @@ # # === 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)) - } - +class tripleo::profile::pacemaker::neutron::plugins::plumgrid +{ + include ::tripleo::profile::base::neutron::plugins::plumgrid } diff --git a/manifests/profile/pacemaker/neutron/server.pp b/manifests/profile/pacemaker/neutron/server.pp index 0bad1b9..d817ee7 100644 --- a/manifests/profile/pacemaker/neutron/server.pp +++ b/manifests/profile/pacemaker/neutron/server.pp @@ -20,7 +20,7 @@ # # [*pacemaker_master*] # (Optional) The hostname of the pacemaker master -# Defaults to hiera('bootstrap_nodeid') +# Defaults to hiera('bootstrap_nodeid', undef) # # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates @@ -28,17 +28,15 @@ # Defaults to hiera('step') # class tripleo::profile::pacemaker::neutron::server ( - $pacemaker_master = hiera('bootstrap_nodeid'), + $pacemaker_master = hiera('bootstrap_nodeid', undef), $step = hiera('step'), ) { - include ::neutron::params include ::tripleo::profile::pacemaker::neutron $sync_db = ($::hostname == downcase($pacemaker_master)) - if $step >= 2 and $sync_db { + if $step >= 3 and $sync_db { include ::neutron::db::mysql - Exec<| title == 'galera-ready'|> -> Class['neutron::db::mysql'] } if $step >= 4 or ( $step >= 3 and $sync_db ) { diff --git a/manifests/profile/pacemaker/nova.pp b/manifests/profile/pacemaker/nova.pp index b6e6cba..222035e 100644 --- a/manifests/profile/pacemaker/nova.pp +++ b/manifests/profile/pacemaker/nova.pp @@ -25,7 +25,6 @@ class tripleo::profile::pacemaker::nova ( $step = hiera('step'), ) { - Service <| tag == 'nova-service' |> { @@ -35,6 +34,4 @@ class tripleo::profile::pacemaker::nova ( stop => '/bin/true', } - include ::tripleo::profile::base::nova - } diff --git a/manifests/profile/pacemaker/nova/api.pp b/manifests/profile/pacemaker/nova/api.pp index 5d8e11f..188beda 100644 --- a/manifests/profile/pacemaker/nova/api.pp +++ b/manifests/profile/pacemaker/nova/api.pp @@ -18,31 +18,70 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to downcase(hiera('bootstrap_nodeid')) +# # [*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')), + $step = hiera('step'), ) { include ::nova::params include ::tripleo::profile::pacemaker::nova - class { '::tripleo::profile::base::nova::api': - sync_db => (downcase($::hostname) == $pacemaker_master), + Service<| title == 'nova-api' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', } + include ::tripleo::profile::base::nova::api + if $step >= 5 and downcase($::hostname) == $pacemaker_master { pacemaker::resource::service { $::nova::params::api_service_name: clone_params => 'interleave=true', } + + pacemaker::constraint::base { 'nova-vncproxy-then-nova-api-constraint': + constraint_type => 'order', + first_resource => "${::nova::params::vncproxy_service_name}-clone", + second_resource => "${::nova::params::api_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::nova::params::vncproxy_service_name], + Pacemaker::Resource::Service[$::nova::params::api_service_name]], + } + pacemaker::constraint::colocation { 'nova-api-with-nova-vncproxy-colocation': + source => "${::nova::params::api_service_name}-clone", + target => "${::nova::params::vncproxy_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::nova::params::vncproxy_service_name], + Pacemaker::Resource::Service[$::nova::params::api_service_name]], + } + pacemaker::constraint::base { 'nova-api-then-nova-scheduler-constraint': + constraint_type => 'order', + first_resource => "${::nova::params::api_service_name}-clone", + second_resource => "${::nova::params::scheduler_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::nova::params::api_service_name], + Pacemaker::Resource::Service[$::nova::params::scheduler_service_name]], + } + pacemaker::constraint::colocation { 'nova-scheduler-with-nova-api-colocation': + source => "${::nova::params::scheduler_service_name}-clone", + target => "${::nova::params::api_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::nova::params::api_service_name], + Pacemaker::Resource::Service[$::nova::params::scheduler_service_name]], + } + } } diff --git a/manifests/profile/pacemaker/nova/conductor.pp b/manifests/profile/pacemaker/nova/conductor.pp index 76dc462..f2605cb 100644 --- a/manifests/profile/pacemaker/nova/conductor.pp +++ b/manifests/profile/pacemaker/nova/conductor.pp @@ -18,28 +18,59 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# # [*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::conductor ( - $step = hiera('step'), $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), ) { include ::nova::params include ::tripleo::profile::pacemaker::nova include ::tripleo::profile::base::nova::conductor + Service<| title == 'nova-conductor' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + if $step >= 5 and downcase($::hostname) == $pacemaker_master { pacemaker::resource::service { $::nova::params::conductor_service_name: clone_params => 'interleave=true', } + + pacemaker::constraint::base { 'nova-scheduler-then-nova-conductor-constraint': + constraint_type => 'order', + first_resource => "${::nova::params::scheduler_service_name}-clone", + second_resource => "${::nova::params::conductor_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::nova::params::scheduler_service_name], + Pacemaker::Resource::Service[$::nova::params::conductor_service_name]], + } + pacemaker::constraint::colocation { 'nova-conductor-with-nova-scheduler-colocation': + source => "${::nova::params::conductor_service_name}-clone", + target => "${::nova::params::scheduler_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::nova::params::scheduler_service_name], + Pacemaker::Resource::Service[$::nova::params::conductor_service_name]], + } + + + # If Service['nova-compute'] is in catalog, make sure we start it after + # nova-conductor pcmk resource. + # Also make sure to restart nova-compute if nova-conductor pcmk resource changed + # the state, since nova-compute is deployed at a previous step. + Pacemaker::Resource::Service[$::nova::params::conductor_service_name] ~> Service<| title == 'nova-compute' |> } } diff --git a/manifests/profile/pacemaker/nova/consoleauth.pp b/manifests/profile/pacemaker/nova/consoleauth.pp index 54f17b7..6cd8c15 100644 --- a/manifests/profile/pacemaker/nova/consoleauth.pp +++ b/manifests/profile/pacemaker/nova/consoleauth.pp @@ -18,28 +18,69 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# # [*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'), + $step = hiera('step'), ) { include ::nova::params include ::tripleo::profile::pacemaker::nova include ::tripleo::profile::base::nova::consoleauth + Service<| title == 'nova-consoleauth' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + if $step >= 5 and downcase($::hostname) == $pacemaker_master { pacemaker::resource::service { $::nova::params::consoleauth_service_name: clone_params => 'interleave=true', } + + pacemaker::constraint::base { 'keystone-then-nova-consoleauth-constraint': + constraint_type => 'order', + first_resource => 'openstack-core-clone', + second_resource => "${::nova::params::consoleauth_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::nova::params::consoleauth_service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + pacemaker::constraint::colocation { 'nova-consoleauth-with-openstack-core': + source => "${::nova::params::consoleauth_service_name}-clone", + target => 'openstack-core-clone', + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::nova::params::consoleauth_service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + pacemaker::constraint::base { 'nova-consoleauth-then-nova-vncproxy-constraint': + constraint_type => 'order', + first_resource => "${::nova::params::consoleauth_service_name}-clone", + second_resource => "${::nova::params::vncproxy_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::nova::params::consoleauth_service_name], + Pacemaker::Resource::Service[$::nova::params::vncproxy_service_name]], + } + pacemaker::constraint::colocation { 'nova-vncproxy-with-nova-consoleauth-colocation': + source => "${::nova::params::vncproxy_service_name}-clone", + target => "${::nova::params::consoleauth_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::nova::params::consoleauth_service_name], + Pacemaker::Resource::Service[$::nova::params::vncproxy_service_name]], + } + } } diff --git a/manifests/profile/pacemaker/nova/scheduler.pp b/manifests/profile/pacemaker/nova/scheduler.pp index 6516394..8c387d2 100644 --- a/manifests/profile/pacemaker/nova/scheduler.pp +++ b/manifests/profile/pacemaker/nova/scheduler.pp @@ -18,24 +18,30 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# # [*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'), + $step = hiera('step'), ) { - include ::nova::params include ::tripleo::profile::pacemaker::nova include ::tripleo::profile::base::nova::scheduler + Service<| title == 'nova-scheduler' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + 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 index 7f7d095..3652daa 100644 --- a/manifests/profile/pacemaker/nova/vncproxy.pp +++ b/manifests/profile/pacemaker/nova/vncproxy.pp @@ -18,24 +18,30 @@ # # === Parameters # +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# # [*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'), + $step = hiera('step'), ) { - include ::nova::params include ::tripleo::profile::pacemaker::nova include ::tripleo::profile::base::nova::vncproxy + Service<| title == 'nova-vncproxy' |> { + hasrestart => true, + restart => '/bin/true', + start => '/bin/true', + stop => '/bin/true', + } + if $step >= 5 and downcase($::hostname) == $pacemaker_master { pacemaker::resource::service { $::nova::params::vncproxy_service_name: clone_params => 'interleave=true', diff --git a/manifests/profile/pacemaker/rabbitmq.pp b/manifests/profile/pacemaker/rabbitmq.pp index efb91b5..93edec9 100644 --- a/manifests/profile/pacemaker/rabbitmq.pp +++ b/manifests/profile/pacemaker/rabbitmq.pp @@ -22,21 +22,20 @@ # (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') # +# [*erlang_cookie*] +# (Optional) Content of erlang cookie. +# Defaults to hiera('rabbitmq::erlang_cookie'). +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # -# [*erlang_cookie*] -# (Optional) Content of erlang cookie. -# Defaults to hiera('rabbitmq::erlang_cookie'). -# class tripleo::profile::pacemaker::rabbitmq ( $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), $erlang_cookie = hiera('rabbitmq::erlang_cookie'), + $step = hiera('step'), ) { - if $::hostname == downcase($bootstrap_node) { $pacemaker_master = true } else { diff --git a/manifests/profile/pacemaker/sahara.pp b/manifests/profile/pacemaker/sahara.pp index 04b4edf..07cd882 100644 --- a/manifests/profile/pacemaker/sahara.pp +++ b/manifests/profile/pacemaker/sahara.pp @@ -18,20 +18,14 @@ # # === Parameters # -# [*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::sahara ( - $bootstrap_node = hiera('bootstrap_nodeid'), - $step = hiera('step'), + $step = hiera('step'), ) { - Service <| tag == 'sahara-service' |> { hasrestart => true, restart => '/bin/true', @@ -39,43 +33,5 @@ class tripleo::profile::pacemaker::sahara ( stop => '/bin/true', } - if $::hostname == downcase($bootstrap_node) { - $pacemaker_master = true - } else { - $pacemaker_master = false - } - - include ::tripleo::profile::base::sahara-api - class { '::tripleo::profile::base::sahara-engine': - sync_db => $pacemaker_master, - } - - if $step >= 5 and $pacemaker_master { - # Sahara - pacemaker::resource::service { $::sahara::params::api_service_name : - clone_params => 'interleave=true', - require => Pacemaker::Resource::Ocf['openstack-core'], - } - pacemaker::resource::service { $::sahara::params::engine_service_name : - clone_params => 'interleave=true', - } - pacemaker::constraint::base { 'keystone-then-sahara-api-constraint': - constraint_type => 'order', - first_resource => 'openstack-core-clone', - second_resource => "${::sahara::params::api_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::sahara::params::api_service_name], - Pacemaker::Resource::Ocf['openstack-core']], - } - pacemaker::constraint::base { 'sahara-api-then-sahara-engine-constraint': - constraint_type => 'order', - first_resource => "${::sahara::params::api_service_name}-clone", - second_resource => "${::sahara::params::engine_service_name}-clone", - first_action => 'start', - second_action => 'start', - require => [Pacemaker::Resource::Service[$::sahara::params::api_service_name], - Pacemaker::Resource::Service[$::sahara::params::engine_service_name]], - } - } + include ::tripleo::profile::base::sahara } diff --git a/manifests/profile/pacemaker/sahara/api.pp b/manifests/profile/pacemaker/sahara/api.pp new file mode 100644 index 0000000..0e3d97a --- /dev/null +++ b/manifests/profile/pacemaker/sahara/api.pp @@ -0,0 +1,49 @@ +# 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::sahara::api +# +# Sahara API Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::sahara::api ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::sahara + include ::tripleo::profile::base::sahara::api + + if $step >= 5 and $pacemaker_master { + # Sahara + pacemaker::resource::service { $::sahara::params::api_service_name : + clone_params => 'interleave=true', + } + } +} diff --git a/manifests/profile/pacemaker/sahara/engine.pp b/manifests/profile/pacemaker/sahara/engine.pp new file mode 100644 index 0000000..ada6c06 --- /dev/null +++ b/manifests/profile/pacemaker/sahara/engine.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::sahara::engine +# +# Sahara Engine Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*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::sahara::engine ( + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + include ::tripleo::profile::pacemaker::sahara + include ::tripleo::profile::base::sahara::engine + + if $step >= 5 and $pacemaker_master { + pacemaker::resource::service { $::sahara::params::engine_service_name : + clone_params => 'interleave=true', + } + } +} |