summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-06-06 13:40:18 -0400
committerJason DeTiberus <jdetiber@redhat.com>2015-06-06 13:44:57 -0400
commit2283750d0ad8b24a823f034ebd6172526c535943 (patch)
tree86f98f293cda97848e072aa292d2d86c017caed9 /roles/openshift_facts
parentaf8b0b25f5e572ab20e3c3efdba596bae7ae7563 (diff)
downloadopenshift-2283750d0ad8b24a823f034ebd6172526c535943.tar.gz
openshift-2283750d0ad8b24a823f034ebd6172526c535943.tar.bz2
openshift-2283750d0ad8b24a823f034ebd6172526c535943.tar.xz
openshift-2283750d0ad8b24a823f034ebd6172526c535943.zip
add use_fluentd to openshift_facts
- Move use_fluentd into openshift_facts proper - default use_fluentd to False unless deployment_type == origin
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 9c2657ff2..aff7d723e 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -288,6 +288,21 @@ def normalize_provider_facts(provider, metadata):
facts = normalize_openstack_facts(metadata, facts)
return facts
+def set_fluentd_facts_if_unset(facts):
+ """ Set fluentd facts if not already present in facts dict
+
+ Args:
+ facts (dict): existing facts
+ Returns:
+ dict: the facts dict updated with the generated fluentd facts if
+ missing
+ """
+ if 'common' in facts:
+ deployment_type = facts['common']['deployment_type']
+ if 'use_fluentd' not in facts['common']:
+ use_fluentd = True if deployment_type == 'online' else False
+ facts['common']['use_fluentd'] = use_fluentd
+ return facts
def set_url_facts_if_unset(facts):
""" Set url facts if not already present in facts dict
@@ -560,6 +575,7 @@ class OpenShiftFacts(object):
facts = merge_facts(facts, local_facts)
facts['current_config'] = get_current_config(facts)
facts = set_url_facts_if_unset(facts)
+ facts = set_fluentd_facts_if_unset(facts)
return dict(openshift=facts)
def get_defaults(self, roles):