summaryrefslogtreecommitdiffstats
path: root/roles/openshift_sanitize_inventory
diff options
context:
space:
mode:
authorEric Wolinetz <ewolinet@redhat.com>2017-10-25 20:45:34 -0500
committerEric Wolinetz <ewolinet@redhat.com>2018-01-02 11:16:04 -0600
commit8cb27ae800df71ee816852df56cd2c861a0f0a0a (patch)
tree9a3f000d6bb886296912df6de0ececdfe7783a53 /roles/openshift_sanitize_inventory
parent332764e4541d8c922f2589a533bb56b2a2419ac1 (diff)
downloadopenshift-8cb27ae800df71ee816852df56cd2c861a0f0a0a.tar.gz
openshift-8cb27ae800df71ee816852df56cd2c861a0f0a0a.tar.bz2
openshift-8cb27ae800df71ee816852df56cd2c861a0f0a0a.tar.xz
openshift-8cb27ae800df71ee816852df56cd2c861a0f0a0a.zip
Updating logging_facts to be able to pull values from config maps yaml files, use diffs to keep custom changes, white list certain settings when creating diffs
Diffstat (limited to 'roles/openshift_sanitize_inventory')
-rw-r--r--roles/openshift_sanitize_inventory/library/conditional_set_fact.py68
-rw-r--r--roles/openshift_sanitize_inventory/meta/main.yml1
2 files changed, 1 insertions, 68 deletions
diff --git a/roles/openshift_sanitize_inventory/library/conditional_set_fact.py b/roles/openshift_sanitize_inventory/library/conditional_set_fact.py
deleted file mode 100644
index f61801714..000000000
--- a/roles/openshift_sanitize_inventory/library/conditional_set_fact.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/python
-
-""" Ansible module to help with setting facts conditionally based on other facts """
-
-from ansible.module_utils.basic import AnsibleModule
-
-
-DOCUMENTATION = '''
----
-module: conditional_set_fact
-
-short_description: This will set a fact if the value is defined
-
-description:
- - "To avoid constant set_fact & when conditions for each var we can use this"
-
-author:
- - Eric Wolinetz ewolinet@redhat.com
-'''
-
-
-EXAMPLES = '''
-- name: Conditionally set fact
- conditional_set_fact:
- fact1: not_defined_variable
-
-- name: Conditionally set fact
- conditional_set_fact:
- fact1: not_defined_variable
- fact2: defined_variable
-
-'''
-
-
-def run_module():
- """ The body of the module, we check if the variable name specified as the value
- for the key is defined. If it is then we use that value as for the original key """
-
- module = AnsibleModule(
- argument_spec=dict(
- facts=dict(type='dict', required=True),
- vars=dict(required=False, type='dict', default=[])
- ),
- supports_check_mode=True
- )
-
- local_facts = dict()
- is_changed = False
-
- for param in module.params['vars']:
- other_var = module.params['vars'][param]
-
- if other_var in module.params['facts']:
- local_facts[param] = module.params['facts'][other_var]
- if not is_changed:
- is_changed = True
-
- return module.exit_json(changed=is_changed, # noqa: F405
- ansible_facts=local_facts)
-
-
-def main():
- """ main """
- run_module()
-
-
-if __name__ == '__main__':
- main()
diff --git a/roles/openshift_sanitize_inventory/meta/main.yml b/roles/openshift_sanitize_inventory/meta/main.yml
index 324ba06d8..cde3eccb6 100644
--- a/roles/openshift_sanitize_inventory/meta/main.yml
+++ b/roles/openshift_sanitize_inventory/meta/main.yml
@@ -14,3 +14,4 @@ galaxy_info:
- system
dependencies:
- role: lib_utils
+- role: lib_openshift