summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/filter_plugins/filters.py
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-09-07 16:32:56 -0400
committerGitHub <noreply@github.com>2017-09-07 16:32:56 -0400
commit7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8 (patch)
treeb900625cbb8a97af4d2cf0d19d452bd643a9e0ec /roles/openshift_aws/filter_plugins/filters.py
parentdc0e3d218ba953e1bc1525ef337f99677deee6c3 (diff)
parentefe86b44bce679db38cca654818dc3837bb05f6a (diff)
downloadopenshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.gz
openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.bz2
openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.xz
openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.zip
Merge pull request #5211 from kwoodson/provisioning_fixes
Provisioning updates.
Diffstat (limited to 'roles/openshift_aws/filter_plugins/filters.py')
-rw-r--r--roles/openshift_aws/filter_plugins/filters.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/openshift_aws/filter_plugins/filters.py b/roles/openshift_aws/filter_plugins/filters.py
new file mode 100644
index 000000000..06e1f9602
--- /dev/null
+++ b/roles/openshift_aws/filter_plugins/filters.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+'''
+Custom filters for use in openshift_aws
+'''
+
+
+class FilterModule(object):
+ ''' Custom ansible filters for use by openshift_aws role'''
+
+ @staticmethod
+ def build_instance_tags(clusterid, status='owned'):
+ ''' This function will return a dictionary of the instance tags.
+
+ The main desire to have this inside of a filter_plugin is that we
+ need to build the following key.
+
+ {"kubernetes.io/cluster/{{ openshift_aws_clusterid }}": 'owned'}
+
+ '''
+ tags = {'clusterid': clusterid,
+ 'kubernetes.io/cluster/{}'.format(clusterid): status}
+
+ return tags
+
+ def filters(self):
+ ''' returns a mapping of filters to methods '''
+ return {'build_instance_tags': self.build_instance_tags}