diff options
author | Michael Gugino <mgugino@redhat.com> | 2017-11-27 15:39:46 -0500 |
---|---|---|
committer | Michael Gugino <mgugino@redhat.com> | 2017-12-07 14:37:36 -0500 |
commit | eb6b20fc9183cc2aae424c72efd1191b99110a93 (patch) | |
tree | ae3dec3c4b4581471f3de0afd8a1711235242cc6 /roles/openshift_facts | |
parent | 37ffebc86cd4fe89373542285b40d92f61696270 (diff) | |
download | openshift-eb6b20fc9183cc2aae424c72efd1191b99110a93.tar.gz openshift-eb6b20fc9183cc2aae424c72efd1191b99110a93.tar.bz2 openshift-eb6b20fc9183cc2aae424c72efd1191b99110a93.tar.xz openshift-eb6b20fc9183cc2aae424c72efd1191b99110a93.zip |
Remove openshift.common.service_type
This commit removes openshift.common.service_type
in favor of openshift_service_type.
This commit also removes r_openshift_excluder_service_type
from plays in favor of using the role's defaults.
Diffstat (limited to 'roles/openshift_facts')
-rw-r--r-- | roles/openshift_facts/defaults/main.yml | 6 | ||||
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/roles/openshift_facts/defaults/main.yml b/roles/openshift_facts/defaults/main.yml index a182d23c5..53a3bc87e 100644 --- a/roles/openshift_facts/defaults/main.yml +++ b/roles/openshift_facts/defaults/main.yml @@ -98,3 +98,9 @@ openshift_prometheus_alertbuffer_storage_create_pvc: False openshift_router_selector: "region=infra" openshift_hosted_router_selector: "{{ openshift_router_selector }}" openshift_hosted_registry_selector: "{{ openshift_router_selector }}" + +openshift_service_type_dict: + origin: origin + openshift-enterprise: atomic-openshift + +openshift_service_type: "{{ openshift_service_type_dict[openshift_deployment_type] }}" diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index d2bd7357a..33c260bef 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -537,7 +537,7 @@ def set_aggregate_facts(facts): def set_deployment_facts_if_unset(facts): """ Set Facts that vary based on deployment_type. This currently - includes common.service_type, master.registry_url, node.registry_url, + includes master.registry_url, node.registry_url, node.storage_plugin_deps Args: @@ -549,14 +549,6 @@ def set_deployment_facts_if_unset(facts): # disabled to avoid breaking up facts related to deployment type into # multiple methods for now. # pylint: disable=too-many-statements, too-many-branches - if 'common' in facts: - deployment_type = facts['common']['deployment_type'] - if 'service_type' not in facts['common']: - service_type = 'atomic-openshift' - if deployment_type == 'origin': - service_type = 'origin' - facts['common']['service_type'] = service_type - for role in ('master', 'node'): if role in facts: deployment_type = facts['common']['deployment_type'] @@ -1020,8 +1012,13 @@ def get_container_openshift_version(facts): If containerized, see if we can determine the installed version via the systemd environment files. """ + deployment_type = facts['common']['deployment_type'] + service_type_dict = {'origin': 'origin', + 'openshift-enterprise': 'atomic-openshift'} + service_type = service_type_dict[deployment_type] + for filename in ['/etc/sysconfig/%s-master-controllers', '/etc/sysconfig/%s-node']: - env_path = filename % facts['common']['service_type'] + env_path = filename % service_type if not os.path.exists(env_path): continue |