From 58818a6af147e457d56a1faf77b02d37bb538826 Mon Sep 17 00:00:00 2001
From: Sanjeev Rampal <srampal@cisco.com>
Date: Thu, 23 Feb 2017 12:25:34 -0800
Subject: Combined (squashed) commit for all changes related to adding Contiv
 support into Openshift Ansible. This is the first (beta) release of Contiv
 with Openshift and is only supported for Openshift Origin + Bare metal
 deployments at the time of this commit. Please refer to the Openshift and
 Contiv official documentation for details of the level of support for
 different features and modes of operation.

---
 roles/openshift_facts/library/openshift_facts.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

(limited to 'roles/openshift_facts/library')

diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index ef7f159c5..23a2bbcde 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -485,6 +485,24 @@ def set_nuage_facts_if_unset(facts):
     return facts
 
 
+def set_contiv_facts_if_unset(facts):
+    """ Set contiv facts if not already present in facts dict
+            dict: the facts dict updated with the contiv facts if
+            missing
+        Args:
+            facts (dict): existing facts
+        Returns:
+            dict: the facts dict updated with the contiv
+            facts if they were not already present
+
+    """
+    if 'common' in facts:
+        if 'use_contiv' not in facts['common']:
+            use_contiv = False
+            facts['common']['use_contiv'] = use_contiv
+    return facts
+
+
 def set_node_schedulability(facts):
     """ Set schedulable facts if not already present in facts dict
         Args:
@@ -1936,6 +1954,7 @@ class OpenShiftFacts(object):
         facts = set_project_cfg_facts_if_unset(facts)
         facts = set_flannel_facts_if_unset(facts)
         facts = set_nuage_facts_if_unset(facts)
+        facts = set_contiv_facts_if_unset(facts)
         facts = set_node_schedulability(facts)
         facts = set_selectors(facts)
         facts = set_identity_providers_if_unset(facts)
-- 
cgit v1.2.3