Browse Source

Remove set_fact usage from web-console role

This commit removes unnecessary set_fact and
with_first_found vars usage from openshift_web_console
role.
Michael Gugino 7 years ago
parent
commit
37bab63caa

+ 20 - 0
roles/openshift_web_console/defaults/main.yml

@@ -1,2 +1,22 @@
 ---
 openshift_web_console_nodeselector: {"node-role.kubernetes.io/master":"true"}
+
+__console_template_file: "console-template.yaml"
+__console_rbac_file: "console-rbac-template.yaml"
+__console_config_file: "console-config.yaml"
+
+openshift_web_console_image_dict:
+  origin:
+    prefix: "docker.io/openshift/origin-"
+    version: "{{ openshift_image_tag }}"
+    image_name: "web-console"
+  openshift-enterprise:
+    prefix: "registry.access.redhat.com/openshift3/ose-"
+    version: "{{ openshift_image_tag }}"
+    image_name: "web-console"
+
+openshift_web_console_prefix: "{{ openshift_web_console_image_dict[openshift_deployment_type]['prefix'] }}"
+openshift_web_console_version: "{{ openshift_web_console_image_dict[openshift_deployment_type]['version'] }}"
+openshift_web_console_image_name: "{{ openshift_web_console_image_dict[openshift_deployment_type]['image_name'] }}"
+# Default the replica count to the number of masters.
+openshift_web_console_replica_count: "{{ groups.oo_masters_to_config | length }}"

+ 0 - 15
roles/openshift_web_console/tasks/install.yml

@@ -1,19 +1,4 @@
 ---
-# Fact setting
-- name: Set default image variables based on deployment type
-  include_vars: "{{ item }}"
-  with_first_found:
-  - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
-  - "default_images.yml"
-
-- name: Set openshift_web_console facts
-  set_fact:
-    openshift_web_console_prefix: "{{ openshift_web_console_prefix | default(__openshift_web_console_prefix) }}"
-    openshift_web_console_version: "{{ openshift_web_console_version | default(__openshift_web_console_version) }}"
-    openshift_web_console_image_name: "{{ openshift_web_console_image_name | default(__openshift_web_console_image_name) }}"
-    # Default the replica count to the number of masters.
-    openshift_web_console_replica_count: "{{ openshift_web_console_replica_count | default(groups.oo_masters_to_config | length) }}"
-
 - name: Ensure openshift-web-console project exists
   oc_project:
     name: openshift-web-console

+ 0 - 4
roles/openshift_web_console/vars/default_images.yml

@@ -1,4 +0,0 @@
----
-__openshift_web_console_prefix: "docker.io/openshift/origin-"
-__openshift_web_console_version: "{{ openshift_image_tag }}"
-__openshift_web_console_image_name: "web-console"

+ 0 - 3
roles/openshift_web_console/vars/main.yml

@@ -1,4 +1 @@
 ---
-__console_template_file: "console-template.yaml"
-__console_rbac_file: "console-rbac-template.yaml"
-__console_config_file: "console-config.yaml"

+ 0 - 4
roles/openshift_web_console/vars/openshift-enterprise.yml

@@ -1,4 +0,0 @@
----
-__openshift_web_console_prefix: "registry.access.redhat.com/openshift3/ose-"
-__openshift_web_console_version: "{{ openshift_image_tag }}"
-__openshift_web_console_image_name: "web-console"