diff options
-rw-r--r-- | manifests/haproxy.pp | 108 | ||||
-rw-r--r-- | manifests/pacemaker/resource_restart_flag.pp | 35 | ||||
-rw-r--r-- | manifests/profile/base/cinder/volume/iscsi.pp | 5 | ||||
-rw-r--r-- | manifests/profile/base/pacemaker.pp | 4 | ||||
-rw-r--r-- | manifests/profile/pacemaker/cinder/backup.pp | 6 | ||||
-rw-r--r-- | manifests/profile/pacemaker/cinder/volume.pp | 6 | ||||
-rw-r--r-- | manifests/profile/pacemaker/database/mysql.pp | 6 | ||||
-rw-r--r-- | manifests/profile/pacemaker/database/redis.pp | 8 | ||||
-rw-r--r-- | manifests/profile/pacemaker/haproxy.pp | 6 | ||||
-rw-r--r-- | manifests/profile/pacemaker/manila.pp | 6 | ||||
-rw-r--r-- | manifests/profile/pacemaker/rabbitmq.pp | 6 |
11 files changed, 141 insertions, 55 deletions
diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp index b2cc264..a79bf14 100644 --- a/manifests/haproxy.pp +++ b/manifests/haproxy.pp @@ -111,99 +111,99 @@ # # [*keystone_admin*] # (optional) Enable or not Keystone Admin API binding -# Defaults to false +# Defaults to hiera('keystone_enabled', false) # # [*keystone_public*] # (optional) Enable or not Keystone Public API binding -# Defaults to false +# Defaults to hiera('keystone_enabled', false) # # [*neutron*] # (optional) Enable or not Neutron API binding -# Defaults to false +# Defaults to hiera('neutron_api_enabled', false) # # [*cinder*] # (optional) Enable or not Cinder API binding -# Defaults to false +# Defaults to hiera('cinder_api_enabled', false) # # [*manila*] # (optional) Enable or not Manila API binding -# Defaults to false +# Defaults to hiera('manila_api_enabled', false) # # [*sahara*] # (optional) Enable or not Sahara API binding -# defaults to false +# defaults to hiera('sahara_api_enabled', false) # # [*trove*] # (optional) Enable or not Trove API binding -# defaults to false +# defaults to hiera('trove_api_enabled', false) # # [*glance_api*] # (optional) Enable or not Glance API binding -# Defaults to false +# Defaults to hiera('glance_api_enabled', false) # # [*glance_registry*] # (optional) Enable or not Glance registry binding -# Defaults to false +# Defaults to hiera('glance_registry_enabled', false) # # [*nova_osapi*] # (optional) Enable or not Nova API binding -# Defaults to false +# Defaults to hiera('nova_api_enabled', false) # # [*nova_metadata*] # (optional) Enable or not Nova metadata binding -# Defaults to false +# Defaults to hiera('nova_api_enabled', false) # # [*nova_novncproxy*] # (optional) Enable or not Nova novncproxy binding -# Defaults to false +# Defaults to hiera('nova_vncproxy_enabled', false) # # [*ceilometer*] # (optional) Enable or not Ceilometer API binding -# Defaults to false +# Defaults to hiera('ceilometer_api_enabled', false) # # [*aodh*] # (optional) Enable or not Aodh API binding -# Defaults to false +# Defaults to hiera('aodh_api_enabled', false) # # [*gnocchi*] # (optional) Enable or not Gnocchi API binding -# Defaults to false +# Defaults to hiera('gnocchi_api_enabled', false) # # [*mistral*] # (optional) Enable or not Mistral API binding -# Defaults to false +# Defaults to hiera('mistral_api_enabled', false) # # [*swift_proxy_server*] # (optional) Enable or not Swift API binding -# Defaults to false +# Defaults to hiera('swift_proxy_enabled', false) # # [*heat_api*] # (optional) Enable or not Heat API binding -# Defaults to false +# Defaults to hiera('heat_api_enabled', false) # # [*heat_cloudwatch*] # (optional) Enable or not Heat Cloudwatch API binding -# Defaults to false +# Defaults to hiera('heat_api_cloudwatch_enabled', false) # # [*heat_cfn*] # (optional) Enable or not Heat CFN API binding -# Defaults to false +# Defaults to hiera('heat_api_cfn_enabled', false) # # [*horizon*] # (optional) Enable or not Horizon dashboard binding -# Defaults to false +# Defaults to hiera('horizon_enabled', false) # # [*ironic*] # (optional) Enable or not Ironic API binding -# Defaults to false +# Defaults to hiera('ironic_enabled', false) # # [*ironic_inspector*] # (optional) Enable or not Ironic Inspector API binding -# Defaults to false +# Defaults to hiera('ironic_inspector_enabled', false) # # [*mysql*] # (optional) Enable or not MySQL Galera binding -# Defaults to false +# Defaults to hiera('mysql_enabled', false) # # [*mysql_clustercheck*] # (optional) Enable check via clustercheck for mysql @@ -215,7 +215,7 @@ # # [*redis*] # (optional) Enable or not Redis binding -# Defaults to false +# Defaults to hiera('redis_enabled', false) # # [*redis_password*] # (optional) Password for Redis authentication, eventually needed by the @@ -228,11 +228,11 @@ # # [*zaqar_api*] # (optional) Enable or not Zaqar Api binding -# Defaults to false +# Defaults to hiera('zaqar_api_enabled', false) # # [*opendaylight*] # (optional) Enable or not OpenDaylight binding -# Defaults to false +# Defaults to hiera('opendaylight_api_enabled', false) # # [*service_ports*] # (optional) Hash that contains the values to override from the service ports @@ -303,37 +303,37 @@ class tripleo::haproxy ( $ssl_cipher_suite = '!SSLv2:kEECDH:kRSA:kEDH:kPSK:+3DES:!aNULL:!eNULL:!MD5:!EXP:!RC4:!SEED:!IDEA:!DES', $ssl_options = 'no-sslv3', $haproxy_stats_certificate = undef, - $keystone_admin = false, - $keystone_public = false, - $neutron = false, - $cinder = false, - $sahara = false, - $trove = false, - $manila = false, - $glance_api = false, - $glance_registry = false, - $nova_osapi = false, - $nova_metadata = false, - $nova_novncproxy = false, - $ceilometer = false, - $aodh = false, - $gnocchi = false, - $mistral = false, - $swift_proxy_server = false, - $heat_api = false, - $heat_cloudwatch = false, - $heat_cfn = false, - $horizon = false, - $ironic = false, - $ironic_inspector = false, - $mysql = false, + $keystone_admin = hiera('keystone_enabled', false), + $keystone_public = hiera('keystone_enabled', false), + $neutron = hiera('neutron_api_enabled', false), + $cinder = hiera('cinder_api_enabled', false), + $manila = hiera('manila_api_enabled', false), + $sahara = hiera('sahara_api_enabled', false), + $trove = hiera('trove_api_enabled', false), + $glance_api = hiera('glance_api_enabled', false), + $glance_registry = hiera('glance_registry_enabled', false), + $nova_osapi = hiera('nova_api_enabled', false), + $nova_metadata = hiera('nova_api_enabled', false), + $nova_novncproxy = hiera('nova_vncproxy_enabled', false), + $ceilometer = hiera('ceilometer_api_enabled', false), + $aodh = hiera('aodh_api_enabled', false), + $gnocchi = hiera('gnocchi_api_enabled', false), + $mistral = hiera('mistral_api_enabled', false), + $swift_proxy_server = hiera('swift_proxy_enabled', false), + $heat_api = hiera('heat_api_enabled', false), + $heat_cloudwatch = hiera('heat_api_cloudwatch_enabled', false), + $heat_cfn = hiera('heat_api_cfn_enabled', false), + $horizon = hiera('horizon_enabled', false), + $ironic = hiera('ironic_api_enabled', false), + $ironic_inspector = hiera('ironic_inspector_enabled', false), + $mysql = hiera('mysql_enabled', false), $mysql_clustercheck = false, $rabbitmq = false, - $redis = false, + $redis = hiera('redis_enabled', false), $redis_password = undef, $midonet_api = false, - $zaqar_api = false, - $opendaylight = false, + $zaqar_api = hiera('zaqar_api_enabled', false), + $opendaylight = hiera('opendaylight_api_enabled', false), $service_ports = {} ) { $default_service_ports = { diff --git a/manifests/pacemaker/resource_restart_flag.pp b/manifests/pacemaker/resource_restart_flag.pp new file mode 100644 index 0000000..aded802 --- /dev/null +++ b/manifests/pacemaker/resource_restart_flag.pp @@ -0,0 +1,35 @@ +# 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. +# +# == Define: tripleo::pacemaker::resource_restart_flag +# +# Creates a flag file on the filesystem to signify that a pacemaker +# resource needs restarting (usually to pick up config changes after +# they've been written on all nodes). +# +# === Parameters +# +# [*title*] +# The resource name in Pacemaker to restart. If it's a cloned +# resource, the name should include the '-clone' part. +# +define tripleo::pacemaker::resource_restart_flag() { + + exec { "${title} resource restart flag": + command => "touch /var/lib/tripleo/pacemaker-restarts/${title}", + path => ['/bin','/usr/bin','/sbin','/usr/sbin'], + refreshonly => true, + } + +} diff --git a/manifests/profile/base/cinder/volume/iscsi.pp b/manifests/profile/base/cinder/volume/iscsi.pp index d1d22bb..8baaf1c 100644 --- a/manifests/profile/base/cinder/volume/iscsi.pp +++ b/manifests/profile/base/cinder/volume/iscsi.pp @@ -52,8 +52,11 @@ class tripleo::profile::base::cinder::volume::iscsi ( size => join([$cinder_lvm_loop_device_size, 'M']), } + # NOTE(gfidente): never emit in hieradata: + # key: [ipv6] + # as it will cause hiera parsing errors cinder::backend::iscsi { $backend_name : - iscsi_ip_address => $cinder_iscsi_address, + iscsi_ip_address => normalize_ip_for_uri($cinder_iscsi_address), iscsi_helper => $cinder_iscsi_helper, } } diff --git a/manifests/profile/base/pacemaker.pp b/manifests/profile/base/pacemaker.pp index 2c70eab..0d628b5 100644 --- a/manifests/profile/base/pacemaker.pp +++ b/manifests/profile/base/pacemaker.pp @@ -75,6 +75,10 @@ class tripleo::profile::base::pacemaker ( Pacemaker::Resource::Service { op_params => 'start timeout=200s stop timeout=200s', } + + file { '/var/lib/tripleo/pacemaker-restarts': + ensure => directory, + } ~> Tripleo::Pacemaker::Resource_restart_flag<||> } if $step >= 2 { diff --git a/manifests/profile/pacemaker/cinder/backup.pp b/manifests/profile/pacemaker/cinder/backup.pp index 20a0104..72ec456 100644 --- a/manifests/profile/pacemaker/cinder/backup.pp +++ b/manifests/profile/pacemaker/cinder/backup.pp @@ -47,6 +47,12 @@ class tripleo::profile::pacemaker::cinder::backup ( include ::tripleo::profile::base::cinder::backup + if $step >= 3 and $pacemaker_master and hiera('stack_action') == 'UPDATE' { + Cinder_config<||> + ~> + tripleo::pacemaker::resource_restart_flag { "${::cinder::params::backup_service}": } + } + if $step >= 5 and $pacemaker_master { pacemaker::resource::service { $::cinder::params::backup_service : } } diff --git a/manifests/profile/pacemaker/cinder/volume.pp b/manifests/profile/pacemaker/cinder/volume.pp index 5a581eb..82e2522 100644 --- a/manifests/profile/pacemaker/cinder/volume.pp +++ b/manifests/profile/pacemaker/cinder/volume.pp @@ -46,6 +46,12 @@ class tripleo::profile::pacemaker::cinder::volume ( include ::tripleo::profile::base::cinder::volume + if $step >= 3 and $pacemaker_master and hiera('stack_action') == 'UPDATE' { + Cinder_api_paste_ini<||> ~> Tripleo::Pacemaker::Resource_restart_flag["${::cinder::params::volume_service}"] + Cinder_config<||> ~> Tripleo::Pacemaker::Resource_restart_flag["${::cinder::params::volume_service}"] + tripleo::pacemaker::resource_restart_flag { "${::cinder::params::volume_service}": } + } + if $step >= 5 and $pacemaker_master { pacemaker::resource::service { $::cinder::params::volume_service : } } diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp index 2715260..4dc3770 100644 --- a/manifests/profile/pacemaker/database/mysql.pp +++ b/manifests/profile/pacemaker/database/mysql.pp @@ -80,6 +80,12 @@ class tripleo::profile::pacemaker::database::mysql ( mysql_server_options => $mysqld_options, } + if $step >= 1 and $pacemaker_master and hiera('stack_action') == 'UPDATE' { + tripleo::pacemaker::resource_restart_flag { 'galera-master': + subscribe => File['mysql-config-file'], + } + } + if $step >= 2 { if $pacemaker_master { pacemaker::resource::ocf { 'galera' : diff --git a/manifests/profile/pacemaker/database/redis.pp b/manifests/profile/pacemaker/database/redis.pp index 8a37ce9..e081516 100644 --- a/manifests/profile/pacemaker/database/redis.pp +++ b/manifests/profile/pacemaker/database/redis.pp @@ -44,6 +44,14 @@ class tripleo::profile::pacemaker::database::redis ( if $step >= 1 { include ::redis + + if $pacemaker_master and hiera('stack_action') == 'UPDATE' { + tripleo::pacemaker::resource_restart_flag { 'redis-master': + # ouch, but trying to stay close how notification works in + # puppet-redis when pacemaker is not being used + subscribe => Exec["cp -p ${::redis::config_file_orig} ${::redis::config_file}"] + } + } } if $step >= 2 and $pacemaker_master { diff --git a/manifests/profile/pacemaker/haproxy.pp b/manifests/profile/pacemaker/haproxy.pp index 1b83d9b..b2e127b 100644 --- a/manifests/profile/pacemaker/haproxy.pp +++ b/manifests/profile/pacemaker/haproxy.pp @@ -44,6 +44,12 @@ class tripleo::profile::pacemaker::haproxy ( $pacemaker_master = false } + if $step >= 1 and $pacemaker_master and hiera('stack_action') == 'UPDATE' { + tripleo::pacemaker::resource_restart_flag { 'haproxy-clone': + subscribe => Concat['/etc/haproxy/haproxy.cfg'], + } + } + if $step >= 2 and $pacemaker_master and $enable_load_balancer { # FIXME: we should not have to access tripleo::haproxy class # parameters here to configure pacemaker VIPs. The configuration diff --git a/manifests/profile/pacemaker/manila.pp b/manifests/profile/pacemaker/manila.pp index 37c67ab..a7f91fc 100644 --- a/manifests/profile/pacemaker/manila.pp +++ b/manifests/profile/pacemaker/manila.pp @@ -202,6 +202,12 @@ class tripleo::profile::pacemaker::manila ( class { '::manila::backends' : enabled_share_backends => $manila_enabled_backends, } + + if $pacemaker_master and hiera('stack_action') == 'UPDATE' { + Manila_api_paste_ini<||> ~> Tripleo::Pacemaker::Resource_restart_flag["${::manila::params::share_service}"] + Manila_config<||> ~> Tripleo::Pacemaker::Resource_restart_flag["${::manila::params::share_service}"] + tripleo::pacemaker::resource_restart_flag { "${::manila::params::share_service}": } + } } if $step >= 5 and $pacemaker_master { diff --git a/manifests/profile/pacemaker/rabbitmq.pp b/manifests/profile/pacemaker/rabbitmq.pp index 93edec9..1f25e8b 100644 --- a/manifests/profile/pacemaker/rabbitmq.pp +++ b/manifests/profile/pacemaker/rabbitmq.pp @@ -54,6 +54,12 @@ class tripleo::profile::pacemaker::rabbitmq ( require => Class['::rabbitmq'], } + if $step >= 1 and $pacemaker_master and hiera('stack_action') == 'UPDATE' { + tripleo::pacemaker::resource_restart_flag { 'rabbitmq-clone': + subscribe => Class['rabbitmq::service'], + } + } + if $step >= 2 and $pacemaker_master { pacemaker::resource::ocf { 'rabbitmq': ocf_agent_name => 'heartbeat:rabbitmq-cluster', |