summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-11-05 16:27:43 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2015-11-05 16:27:43 -0500
commitc73ec7b6b27483aea4bb53db0db9837ff9781d24 (patch)
tree27ab3e06fe896997bf0f59b0ac3b6b54728f4425 /filter_plugins
parentd01f131de68bf88e4e3fb4c81450922a30285804 (diff)
parent11e7783d4b4177f100ecea8a8ffafbfb07ec47ee (diff)
downloadopenshift-c73ec7b6b27483aea4bb53db0db9837ff9781d24.tar.gz
openshift-c73ec7b6b27483aea4bb53db0db9837ff9781d24.tar.bz2
openshift-c73ec7b6b27483aea4bb53db0db9837ff9781d24.tar.xz
openshift-c73ec7b6b27483aea4bb53db0db9837ff9781d24.zip
Merge pull request #608 from abutcher/native-ha
Native Support for Multi-Master HA
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/oo_filters.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index dfd9a111e..f494c0ae5 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'
+ 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
@@ -407,5 +422,6 @@ class FilterModule(object):
"oo_split": self.oo_split,
"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_parse_certificate_names": self.oo_parse_certificate_names,
+ "oo_haproxy_backend_masters": self.oo_haproxy_backend_masters
}