# FQDN of the Galera master node
# Defaults to undef
#
+# [*galera_master_ip*]
+# IP of the Galera master node
+# Defaults to undef
+#
# [*keystone_admin*]
# (optional) Enable or not Keystone Admin API binding
# Defaults to false
$controller_hosts = undef,
$controller_hosts_names = undef,
$galera_master_hostname = undef,
+ $galera_master_ip = undef,
$keystone_admin = false,
$keystone_public = false,
$neutron = false,
},
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_hosts_real,
- server_names => $controller_hosts_names_real,
- options => $options_real,
+ ipaddresses => $galera_master_ip,
+ server_names => $galera_master_hostname,
+ options => ['check', 'inter 2000', 'rise 2', 'fall 5'],
+ }
+
+ $controller_hosts_without_galera_master = delete($controller_hosts_real, $galera_master_ip)
+ $controller_hosts_names_without_galera_master = delete($controller_hosts_names_real, downcase($galera_master_hostname))
+ haproxy::balancermember { 'mysql-backup':
+ listening_service => 'mysql',
+ ports => '3306',
+ ipaddresses => $controller_hosts_without_galera_master,
+ server_names => $controller_hosts_names_without_galera_master,
+ options => ['check', 'inter 2000', 'rise 2', 'fall 5', 'backup'],
}
}