Allow VIP resource to have customized ops

Introduce meta_params and op_params which will be
passed to the pcs resource create comand when creating
the VIPs. This allows us to specify custom ops for VIPs
in the following manner, by setting hiera. E.g.:
tripleo::profile::pacemaker::haproxy_bundle::op_params: 'start timeout=200s stop timeout=200s monitor timeout=5s'

Change-Id: I9a1c700051fc6dfc302e1d94347df2956442354e
Depends-On: Iadf0cd3805f72141563707f43130945c9d362f5c
Related-Bug: #1719540
This commit is contained in:
Michele Baldessari 2018-03-20 20:29:51 +01:00
parent ed567aadca
commit 8975100f77
3 changed files with 48 additions and 1 deletions

View File

@ -40,6 +40,14 @@
# }
# Defaults to undef
#
# [*meta_params*]
# (optional) Additional meta parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*op_params*]
# (optional) Additional op parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*pcs_tries*]
# (Optional) The number of times pcs commands should be retried.
# Defaults to 1
@ -53,6 +61,8 @@ define tripleo::pacemaker::haproxy_with_vip(
$vip_name,
$ip_address,
$location_rule = undef,
$meta_params = '',
$op_params = '',
$pcs_tries = 1,
$ensure = true)
{
@ -83,8 +93,9 @@ define tripleo::pacemaker::haproxy_with_vip(
cidr_netmask => $netmask,
nic => $nic,
ipv6_addrlabel => $ipv6_addrlabel,
meta_params => 'resource-stickiness=INFINITY',
meta_params => "resource-stickiness=INFINITY ${meta_params}",
location_rule => $location_rule,
op_params => $op_params,
tries => $pcs_tries,
}

View File

@ -31,6 +31,14 @@
# (false means disabled, and true means enabled)
# Defaults to hiera('tripleo::firewall::manage_firewall', true)
#
# [*meta_params*]
# (optional) Additional meta parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*op_params*]
# (optional) Additional op parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
@ -44,6 +52,8 @@ class tripleo::profile::pacemaker::haproxy (
$bootstrap_node = hiera('haproxy_short_bootstrap_node_name'),
$enable_load_balancer = hiera('enable_load_balancer', true),
$manage_firewall = hiera('tripleo::firewall::manage_firewall', true),
$meta_params = '',
$op_params = '',
$step = Integer(hiera('step')),
$pcs_tries = hiera('pcs_tries', 20),
) {
@ -93,6 +103,8 @@ class tripleo::profile::pacemaker::haproxy (
vip_name => 'control',
ip_address => $control_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
require => Pacemaker::Property['haproxy-role-node-property'],
}
@ -103,6 +115,8 @@ class tripleo::profile::pacemaker::haproxy (
vip_name => 'public',
ip_address => $public_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
require => Pacemaker::Property['haproxy-role-node-property'],
}
@ -113,6 +127,8 @@ class tripleo::profile::pacemaker::haproxy (
vip_name => 'redis',
ip_address => $redis_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
require => Pacemaker::Property['haproxy-role-node-property'],
}
@ -126,6 +142,8 @@ class tripleo::profile::pacemaker::haproxy (
vip_name => $net_name,
ip_address => $virtual_ip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
require => Pacemaker::Property['haproxy-role-node-property'],
}

View File

@ -59,6 +59,14 @@
# when TLS is enabled in the internal network
# Defaults to undef
#
# [*meta_params*]
# (optional) Additional meta parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*op_params*]
# (optional) Additional op parameters to pass to "pcs resource create" for the VIP
# Defaults to ''
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
@ -78,6 +86,8 @@ class tripleo::profile::pacemaker::haproxy_bundle (
$internal_certs_directory = undef,
$internal_keys_directory = undef,
$deployed_ssl_cert_path = hiera('tripleo::haproxy::service_certificate', undef),
$meta_params = '',
$op_params = '',
$step = Integer(hiera('step')),
$pcs_tries = hiera('pcs_tries', 20),
) {
@ -239,6 +249,8 @@ class tripleo::profile::pacemaker::haproxy_bundle (
vip_name => 'control',
ip_address => $control_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
}
@ -248,6 +260,8 @@ class tripleo::profile::pacemaker::haproxy_bundle (
vip_name => 'public',
ip_address => $public_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
}
@ -257,6 +271,8 @@ class tripleo::profile::pacemaker::haproxy_bundle (
vip_name => 'redis',
ip_address => $redis_vip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
}
@ -269,6 +285,8 @@ class tripleo::profile::pacemaker::haproxy_bundle (
vip_name => $net_name,
ip_address => $virtual_ip,
location_rule => $haproxy_location_rule,
meta_params => $meta_params,
op_params => $op_params,
pcs_tries => $pcs_tries,
}
}