summaryrefslogtreecommitdiffstats
path: root/roles/openshift_hosted
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2018-01-11 18:43:36 -0500
committerGitHub <noreply@github.com>2018-01-11 18:43:36 -0500
commitfa649787c6a19bbfffb16d9cce3f8e3f7de5a8a1 (patch)
tree6c891a58fb0642d9e0f7399f139940fe46c919e9 /roles/openshift_hosted
parentfdc5829d6ca252e1574278cd1dc50e932378d98d (diff)
parentd3fefc32a727fe3c13159c4e9fe4399f35b487a8 (diff)
downloadopenshift-fa649787c6a19bbfffb16d9cce3f8e3f7de5a8a1.tar.gz
openshift-fa649787c6a19bbfffb16d9cce3f8e3f7de5a8a1.tar.bz2
openshift-fa649787c6a19bbfffb16d9cce3f8e3f7de5a8a1.tar.xz
openshift-fa649787c6a19bbfffb16d9cce3f8e3f7de5a8a1.zip
Merge pull request #6614 from mgugino-upstream-stage/plugins-to-lib-utils
Move more plugins to lib_utils
Diffstat (limited to 'roles/openshift_hosted')
-rw-r--r--roles/openshift_hosted/filter_plugins/openshift_hosted_filters.py42
-rw-r--r--roles/openshift_hosted/tasks/router.yml1
2 files changed, 1 insertions, 42 deletions
diff --git a/roles/openshift_hosted/filter_plugins/openshift_hosted_filters.py b/roles/openshift_hosted/filter_plugins/openshift_hosted_filters.py
deleted file mode 100644
index 003ce5f9e..000000000
--- a/roles/openshift_hosted/filter_plugins/openshift_hosted_filters.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''
-Custom filters for use in openshift_hosted
-'''
-
-
-class FilterModule(object):
- ''' Custom ansible filters for use by openshift_hosted role'''
-
- @staticmethod
- def get_router_replicas(replicas=None, router_nodes=None):
- ''' This function will return the number of replicas
- based on the results from the defined
- openshift_hosted_router_replicas OR
- the query from oc_obj on openshift nodes with a selector OR
- default to 1
-
- '''
- # We always use what they've specified if they've specified a value
- if replicas is not None:
- return replicas
-
- replicas = 1
-
- # Ignore boolean expression limit of 5.
- # pylint: disable=too-many-boolean-expressions
- if (isinstance(router_nodes, dict) and
- 'results' in router_nodes and
- 'results' in router_nodes['results'] and
- isinstance(router_nodes['results']['results'], list) and
- len(router_nodes['results']['results']) > 0 and
- 'items' in router_nodes['results']['results'][0]):
-
- if len(router_nodes['results']['results'][0]['items']) > 0:
- replicas = len(router_nodes['results']['results'][0]['items'])
-
- return replicas
-
- def filters(self):
- ''' returns a mapping of filters to methods '''
- return {'get_router_replicas': self.get_router_replicas}
diff --git a/roles/openshift_hosted/tasks/router.yml b/roles/openshift_hosted/tasks/router.yml
index 2dc9c98f6..c2be00d19 100644
--- a/roles/openshift_hosted/tasks/router.yml
+++ b/roles/openshift_hosted/tasks/router.yml
@@ -18,6 +18,7 @@
- name: set_fact replicas
set_fact:
+ # get_router_replicas is a custom filter in role lib_utils
replicas: "{{ openshift_hosted_router_replicas | default(None) | get_router_replicas(router_nodes) }}"
- name: Get the certificate contents for router