summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2015-09-09 12:03:09 -0400
committerScott Dodson <sdodson@redhat.com>2015-09-10 09:22:33 -0400
commit12b56e720a8221208fbc1c5dd8a7e5732aa4f04e (patch)
treef8e5921035094af05d4235c39022a85a9c88aa85 /roles/openshift_facts/library
parent5ea59791dd5fd30664f076a3a768c34a99ff6af8 (diff)
downloadopenshift-12b56e720a8221208fbc1c5dd8a7e5732aa4f04e.tar.gz
openshift-12b56e720a8221208fbc1c5dd8a7e5732aa4f04e.tar.bz2
openshift-12b56e720a8221208fbc1c5dd8a7e5732aa4f04e.tar.xz
openshift-12b56e720a8221208fbc1c5dd8a7e5732aa4f04e.zip
Move openshift_data_dir to a fact based on deployment_type
Previously this was being set to /var/lib/origin regardless of deployment_type which isn't correct given that existing 'enterprise' and 'online' deployments would have been deployed with /var/lib/openshift
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 679c3273a..60d1226d4 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -454,6 +454,8 @@ def set_deployment_facts_if_unset(facts):
dict: the facts dict updated with the generated deployment_type
facts
"""
+ # Perhaps re-factor this as a map?
+ # pylint: disable=too-many-branches
if 'common' in facts:
deployment_type = facts['common']['deployment_type']
if 'service_type' not in facts['common']:
@@ -470,6 +472,13 @@ def set_deployment_facts_if_unset(facts):
elif deployment_type == 'origin':
config_base = '/etc/openshift'
facts['common']['config_base'] = config_base
+ if 'data_dir' not in facts['common']:
+ data_dir = '/var/lib/origin'
+ if deployment_type in ['enterprise', 'online']:
+ data_dir = '/var/lib/openshift'
+ elif deployment_type == 'origin':
+ data_dir = '/var/lib/openshift'
+ facts['common']['data_dir'] = data_dir
for role in ('master', 'node'):
if role in facts: