summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-08-21 23:49:49 -0400
committerAndrew Butcher <abutcher@redhat.com>2015-11-04 19:57:21 -0500
commit3778662ef816b2bb0a3788ed65229b45622a0139 (patch)
treea64dec3e317a55d87d86a5262ca2b598f625c9de /filter_plugins
parent399b19864653806c769ac954a6c79ef13a895d64 (diff)
downloadopenshift-3778662ef816b2bb0a3788ed65229b45622a0139.tar.gz
openshift-3778662ef816b2bb0a3788ed65229b45622a0139.tar.bz2
openshift-3778662ef816b2bb0a3788ed65229b45622a0139.tar.xz
openshift-3778662ef816b2bb0a3788ed65229b45622a0139.zip
Start of true master ha
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/oo_filters.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index dfd9a111e..80bce80f0 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -243,6 +243,21 @@ class FilterModule(object):
return string.split(separator)
@staticmethod
+ def oo_haproxy_backend_masters(hosts):
+ ''' This takes an array of dicts and returns an array of dicts
+ to be used as a backend for the haproxy role
+ '''
+ servers = []
+ for idx, host_info in enumerate(hosts):
+ server = dict(name="master%s" % idx)
+ server_ip = host_info['openshift']['common']['ip']
+ server_port = host_info['openshift']['master']['api_port']
+ server['address'] = "%s:%s" % (server_ip, server_port)
+ server['opts'] = 'check ssl verify none'
+ servers.append(server)
+ return servers
+
+ @staticmethod
def oo_filter_list(data, filter_attr=None):
''' This returns a list, which contains all items where filter_attr
evaluates to true
@@ -408,4 +423,5 @@ class FilterModule(object):
"oo_filter_list": self.oo_filter_list,
"oo_parse_heat_stack_outputs": self.oo_parse_heat_stack_outputs,
"oo_parse_certificate_names": self.oo_parse_certificate_names
+ "oo_haproxy_backend_masters": self.oo_haproxy_backend_masters
}