summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node_facts/filter_plugins/filters.py
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-09-27 10:18:23 -0400
committerRussell Teague <rteague@redhat.com>2017-09-27 10:45:53 -0400
commit4dcc5042e6a5ab70de755e2d9d3bdab7e37d45f5 (patch)
tree4605416910ddd1874b446e95e8665a76863c687e /roles/openshift_node_facts/filter_plugins/filters.py
parent54c41923ed30ba7e46dd12d15157195feca093a6 (diff)
downloadopenshift-4dcc5042e6a5ab70de755e2d9d3bdab7e37d45f5.tar.gz
openshift-4dcc5042e6a5ab70de755e2d9d3bdab7e37d45f5.tar.bz2
openshift-4dcc5042e6a5ab70de755e2d9d3bdab7e37d45f5.tar.xz
openshift-4dcc5042e6a5ab70de755e2d9d3bdab7e37d45f5.zip
Rename filter_plugins to unique names
Filter plugin modules should have unique names to not conflict with core Ansible modules. (Ansible 2.4)
Diffstat (limited to 'roles/openshift_node_facts/filter_plugins/filters.py')
-rw-r--r--roles/openshift_node_facts/filter_plugins/filters.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/roles/openshift_node_facts/filter_plugins/filters.py b/roles/openshift_node_facts/filter_plugins/filters.py
deleted file mode 100644
index 69069f2dc..000000000
--- a/roles/openshift_node_facts/filter_plugins/filters.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''
-Custom filters for use in openshift-node
-'''
-from ansible import errors
-
-
-class FilterModule(object):
- ''' Custom ansible filters for use by openshift_node_facts role'''
-
- @staticmethod
- def node_get_dns_ip(openshift_dns_ip, hostvars):
- ''' Navigates the complicated logic of when to set dnsIP
-
- In all situations if they've set openshift_dns_ip use that
- For 1.0/3.0 installs we use the openshift_master_cluster_vip, openshift_node_first_master_ip, else None
- For 1.1/3.1 installs we use openshift_master_cluster_vip, else None (product will use kube svc ip)
- For 1.2/3.2+ installs we set to the node's default interface ip
- '''
-
- if not issubclass(type(hostvars), dict):
- raise errors.AnsibleFilterError("|failed expects hostvars is a dict")
-
- # We always use what they've specified if they've specified a value
- if openshift_dns_ip is not None:
- return openshift_dns_ip
- return hostvars['ansible_default_ipv4']['address']
-
- def filters(self):
- ''' returns a mapping of filters to methods '''
- return {'node_get_dns_ip': self.node_get_dns_ip}