aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/pacemaker
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/pacemaker')
-rw-r--r--manifests/profile/pacemaker/cinder/backup.pp6
-rw-r--r--manifests/profile/pacemaker/cinder/volume.pp6
-rw-r--r--manifests/profile/pacemaker/database/mysql.pp46
-rw-r--r--manifests/profile/pacemaker/database/redis.pp8
-rw-r--r--manifests/profile/pacemaker/haproxy.pp6
-rw-r--r--manifests/profile/pacemaker/manila.pp155
-rw-r--r--manifests/profile/pacemaker/rabbitmq.pp6
7 files changed, 142 insertions, 91 deletions
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 31d7d80..0169e16 100644
--- a/manifests/profile/pacemaker/database/mysql.pp
+++ b/manifests/profile/pacemaker/database/mysql.pp
@@ -18,22 +18,41 @@
#
# === Parameters
#
+# [*bind_address*]
+# (Optional) The address that the local mysql instance should bind to.
+# Defaults to $::hostname
+#
+# [*gmcast_listen_addr*]
+# (Optional) This variable defines the address on which the node listens to
+# connections from other nodes in the cluster.
+# Defaults to hiera('mysql_bind_host')
+#
# [*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'),
+ $bind_address = $::hostname,
+ $gmcast_listen_addr = hiera('mysql_bind_host'),
+ $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))
+
+ # use only mysql_node_names when we land a patch in t-h-t that
+ # switches to autogenerating these values from composable services
+ $galera_node_names_lookup = hiera('mysql_node_names', hiera('galera_node_names', $::hostname))
+ if is_array($galera_node_names_lookup) {
+ $galera_nodes = downcase(join($galera_node_names_lookup, ','))
+ } else {
+ $galera_nodes = downcase($galera_node_names_lookup)
+ }
$galera_nodes_count = count(split($galera_nodes, ','))
+
$mysqld_options = {
'mysqld' => {
'skip-name-resolve' => '1',
@@ -43,7 +62,7 @@ class tripleo::profile::pacemaker::database::mysql (
'innodb_locks_unsafe_for_binlog'=> '1',
'query_cache_size' => '0',
'query_cache_type' => '0',
- 'bind-address' => $::hostname,
+ 'bind-address' => $bind_address,
'max_connections' => hiera('mysql_max_connections'),
'open_files_limit' => '-1',
'wsrep_on' => 'ON',
@@ -61,7 +80,7 @@ class tripleo::profile::pacemaker::database::mysql (
'wsrep_drupal_282555_workaround'=> '0',
'wsrep_causal_reads' => '0',
'wsrep_sst_method' => 'rsync',
- 'wsrep_provider_options' => "gmcast.listen_addr=tcp://[${mysql_bind_host}]:4567;",
+ 'wsrep_provider_options' => "gmcast.listen_addr=tcp://${gmcast_listen_addr}:4567;",
}
}
@@ -71,6 +90,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' :
@@ -105,6 +130,11 @@ class tripleo::profile::pacemaker::database::mysql (
table => '*.*',
user => 'clustercheck@localhost',
}
+
+ # We create databases for services at step 2 as well. This ensures
+ # Galara is up before those get created
+ Exec['galera-ready'] -> Mysql_database<||>
+
}
# 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)
@@ -150,8 +180,12 @@ MYSQL_HOST=localhost\n",
# 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')
+ $galera_set_pwd = "/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"
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",
+ command => $galera_set_pwd,
}
file { '/root/.my.cnf' :
ensure => file,
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 43ae875..a1ff5ca 100644
--- a/manifests/profile/pacemaker/manila.pp
+++ b/manifests/profile/pacemaker/manila.pp
@@ -22,84 +22,14 @@
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
-# [*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')
-#
-# [*max_time_to_attach*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::max_time_to_attach')
-#
-# [*max_time_to_create_volume*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::max_time_to_create_volume')
-#
-# [*service_instance_flavor_id*]
-# (Optional)
-# Defaults to hiera('manila::service_instance::service_instance_flavor_id')
-#
-# [*service_instance_password*]
-# (Optional)
-# Defaults to hiera('manila::service_instance::service_instance_password')
-#
-# [*service_instance_smb_config_path*]
-# (Optional)
-# Defaults to downcase(hiera('manila::backend::generic::service_instance_smb_config_path'))
-#
-# [*service_instance_user*]
-# (Optional)
-# Defaults to hiera('manila::service_instance::service_instance_user')
-#
-# [*share_mount_path*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::share_mount_path')
-#
-# [*share_volume_fstype*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::share_volume_fstype')
-#
-# [*smb_template_config_path*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::smb_template_config_path')
-#
# [*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::backend::generic::volume_name_template')
-#
-# [*volume_snapshot_name_template*]
-# (Optional)
-# Defaults to hiera('manila::backend::generic::volume_snapshot_name_template')
-#
class tripleo::profile::pacemaker::manila (
$bootstrap_node = hiera('bootstrap_nodeid'),
- $cinder_volume_type = hiera('manila::backend::generic::cinder_volume_type', ''),
- $driver_handles_share_servers = hiera('manila::backend::generic::driver_handles_share_servers'),
- $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'),
- $service_instance_user = hiera('manila::service_instance::service_instance_user'),
- $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
@@ -116,26 +46,31 @@ class tripleo::profile::pacemaker::manila (
stop => '/bin/true',
}
- if $step >= 4 {
- include ::tripleo::profile::base::manila::api
- include ::tripleo::profile::base::manila::scheduler
- include ::tripleo::profile::base::manila::share
+ include ::tripleo::profile::base::manila::api
+ include ::tripleo::profile::base::manila::scheduler
+ include ::tripleo::profile::base::manila::share
+ if $step >= 4 {
+ # manila generic:
+ $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 :
- driver_handles_share_servers => $driver_handles_share_servers,
- smb_template_config_path => $smb_template_config_path,
- volume_name_template => $volume_name_template ,
- volume_snapshot_name_template => $volume_snapshot_name_template,
- share_mount_path => $share_mount_path,
- max_time_to_create_volume => $max_time_to_create_volume,
- max_time_to_attach => $max_time_to_attach,
- service_instance_smb_config_path => $service_instance_smb_config_path,
- share_volume_fstype => $share_volume_fstype,
- cinder_volume_type => $cinder_volume_type,
+ driver_handles_share_servers => hiera('manila::backend::generic::driver_handles_share_servers', true),
+ 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_smb_config_path => hiera('manila::backend::generic::service_instance_smb_config_path'),
+ 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'),
+ volume_name_template => hiera('manila::backend::generic::volume_name_template'),
+ volume_snapshot_name_template => hiera('manila::backend::generic::volume_snapshot_name_template'),
+ 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')
manila_config {
"${manila_generic_backend}/service_instance_user": value => $service_instance_user;
"${manila_generic_backend}/service_instance_password": value => $service_instance_password;
@@ -145,10 +80,60 @@ class tripleo::profile::pacemaker::manila (
include ::manila::volume::cinder
}
- $manila_enabled_backends = delete_undef_values([$manila_generic_backend])
+ # manila cephfsnative:
+ $manila_cephfsnative_enable = hiera('manila::backend::cephfsnative::enable_backend', false)
+ if $manila_cephfsnative_enable {
+ $manila_cephfsnative_backend = hiera('manila::backend::cephfsnative::title')
+ manila::backend::cephfsnative { $manila_cephfsnative_backend :
+ driver_handles_share_servers => hiera('manila::backend::cephfsnative::driver_handles_share_servers', false),
+ share_backend_name => hiera('manila::backend::cephfsnative::share_backend_name'),
+ cephfs_conf_path => hiera('manila::backend::cephfsnative::cephfs_conf_path'),
+ cephfs_auth_id => hiera('manila::backend::cephfsnative::cephfs_auth_id'),
+ cephfs_cluster_name => hiera('manila::backend::cephfsnative::cephfs_cluster_name'),
+ cephfs_enable_snapshots => hiera('manila::backend::cephfsnative::cephfs_enable_snapshots'),
+ }
+ }
+
+ # manila netapp:
+ $manila_netapp_enable = hiera('manila_netapp_enable_backend', false)
+ if $manila_netapp_enable {
+ $manila_netapp_backend = hiera('manila::backend::netapp::title')
+ manila::backend::netapp { $manila_netapp_backend :
+ driver_handles_share_servers => hiera('manila::backend::netapp::driver_handles_share_servers', true),
+ netapp_login => hiera('manila::backend::netapp::netapp_login'),
+ netapp_password => hiera('manila::backend::netapp::netapp_password'),
+ netapp_server_hostname => hiera('manila::backend::netapp::netapp_server_hostname'),
+ netapp_transport_type => hiera('manila::backend::netapp::netapp_transport_type'),
+ netapp_storage_family => hiera('manila::backend::netapp::netapp_storage_family'),
+ netapp_server_port => hiera('manila::backend::netapp::netapp_server_port'),
+ netapp_volume_name_template => hiera('manila::backend::netapp::netapp_volume_name_template'),
+ netapp_vserver => hiera('manila::backend::netapp::netapp_vserver'),
+ netapp_vserver_name_template => hiera('manila::backend::netapp::netapp_vserver_name_template'),
+ netapp_lif_name_template => hiera('manila::backend::netapp::netapp_lif_name_template'),
+ netapp_aggregate_name_search_pattern => hiera('manila::backend::netapp::netapp_aggregate_name_search_pattern'),
+ netapp_root_volume_aggregate => hiera('manila::backend::netapp::netapp_root_volume_aggregate'),
+ netapp_root_volume_name => hiera('manila::backend::netapp::netapp_root_volume'),
+ netapp_port_name_search_pattern => hiera('manila::backend::netapp::netapp_port_name_search_pattern'),
+ netapp_trace_flags => hiera('manila::backend::netapp::netapp_trace_flags'),
+ }
+ }
+
+ $manila_enabled_backends = delete_undef_values(
+ [
+ $manila_generic_backend,
+ $manila_cephfsnative_backend,
+ $manila_netapp_backend
+ ]
+ )
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',