Browse Source

Enable console picker

The admin and developer consoles link to each other. Add the URLs to the
config for each console to enable the picker in the masthead.
Samuel Padgett 6 years ago
parent
commit
1c87d63dd8

+ 7 - 0
roles/openshift_console/tasks/install.yml

@@ -42,6 +42,11 @@
     dest: "{{ mktemp.stdout }}/{{ __console_config_file }}"
   when: existing_config_map_data['console-config.yaml'] is defined
 
+- set_fact:
+    # Must have a trailing slash
+    console_picker_developer_console_public_url: "{{ openshift.master.public_console_url }}/"
+  when: openshift_web_console_install | default(true) | bool
+
 # Generate a new config when a config map is not defined.
 - name: Set web console config properties from inventory variables
   yedit:
@@ -53,6 +58,8 @@
       value: "{{ openshift_console_base_path | default('') }}"
     - key: clusterInfo#masterPublicURL
       value: "{{ openshift.master.public_api_url }}"
+    - key: clusterInfo#developerConsolePublicURL
+      value: "{{ console_picker_developer_console_public_url | default('') }}"
     - key: auth#oauthEndpointCAFile
       value: "{{ openshift_console_auth_ca_file }}"
     - key: auth#logoutRedirect

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

@@ -59,6 +59,10 @@
   - set_fact:
       cro_plugin_enabled: "{{ config_to_migrate.admissionConfig is defined and config_to_migrate.admissionConfig.pluginConfig is defined and config_to_migrate.admissionConfig.pluginConfig.ClusterResourceOverrides is defined }}"
 
+  - set_fact:
+      console_picker_admin_console_public_url: "https://{{ openshift_console_hostname | default('console.{{openshift_master_default_subdomain}}') }}/"
+    when: openshift_console_install | default(true) | bool
+
   # Update properties in the config template based on inventory vars when the
   # asset config does not exist.
   - name: Set web console config properties from inventory variables
@@ -72,6 +76,8 @@
         value: "{{ openshift.master.public_api_url }}"
       - key: clusterInfo#logoutPublicURL
         value: "{{ openshift.master.logout_url | default('') }}"
+      - key: clusterInfo#adminConsolePublicURL
+        value: "{{ console_picker_admin_console_public_url | default('') }}"
       - key: features#inactivityTimeoutMinutes
         value: "{{ openshift_web_console_inactivity_timeout_minutes | default(0) }}"
       - key: features#clusterResourceOverridesEnabled