aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorYanis Guenane <yanis.guenane@enovance.com>2015-03-26 17:19:48 +0100
committerYanis Guenane <yanis.guenane@enovance.com>2015-03-31 10:32:52 +0200
commit5da4a88d748dc1dde67b84ce57a1a1ffe1e5e466 (patch)
treef0691de1f67f20e4564643f6e737dd3eb4d3b645 /manifests
parent4b4fcb0536de411aa36d39a02e51e78693fcf999 (diff)
loadbalancer: Enable backup mode for Galera
This commit allows to enable backup mode for non master galera node. Change-Id: I8b27f470ae171d77c8c8283797ff1502ef44e17f
Diffstat (limited to 'manifests')
-rw-r--r--manifests/loadbalancer.pp12
1 files changed, 11 insertions, 1 deletions
diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp
index 6b353ef..331c892 100644
--- a/manifests/loadbalancer.pp
+++ b/manifests/loadbalancer.pp
@@ -44,6 +44,10 @@
# Can be a string or an array.
# Defaults to undef
#
+# [*galera_master_hostname*]
+# FQDN of the Galera master node
+# Defaults to undef
+#
# [*keystone_admin*]
# (optional) Enable or not Keystone Admin API binding
# Defaults to false
@@ -122,6 +126,7 @@ class tripleo::loadbalancer (
$control_virtual_interface,
$public_virtual_interface,
$public_virtual_ip,
+ $galera_master_hostname = undef,
$keystone_admin = false,
$keystone_public = false,
$neutron = false,
@@ -491,11 +496,16 @@ class tripleo::loadbalancer (
},
collect_exported => false,
}
+ if downcase($galera_master_hostname) == $::hostname or !$galera_master_hostname {
+ $options_real = ['check', 'inter 2000', 'rise 2', 'fall 5']
+ } else {
+ $options_real = ['check', 'inter 2000', 'rise 2', 'fall 5', 'backup']
+ }
haproxy::balancermember { 'mysql':
listening_service => 'mysql',
ports => '3306',
ipaddresses => $controller_host,
- options => ['check', 'inter 2000', 'rise 2', 'fall 5'],
+ options => $options_real,
}
}