Przeglądaj źródła

Remove default value for oreg_url

Due to some plays importing variables from roles
directly, oreg_url was being set to a default
value when it otherwise shouldn't be.

This commit removes the default values for oreg_url
to ensure existing logic works as desired.

Fixes: https://github.com/openshift/openshift-ansible/issues/5455
Michael Gugino 7 lat temu
rodzic
commit
0fee9f4e19

+ 2 - 2
roles/docker/defaults/main.yml

@@ -1,6 +1,6 @@
 ---
 docker_cli_auth_config_path: '/root/.docker'
 
-oreg_url: ''
-oreg_host: "{{ oreg_url.split('/')[0] if '.' in oreg_url.split('/')[0] else '' }}"
+# oreg_url is defined by user input.
+oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
 oreg_auth_credentials_replace: False

+ 2 - 2
roles/openshift_master/defaults/main.yml

@@ -20,8 +20,8 @@ r_openshift_master_os_firewall_allow:
   port: 4001/tcp
   cond: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
 
-oreg_url: ''
-oreg_host: "{{ oreg_url.split('/')[0] if '.' in oreg_url.split('/')[0] else '' }}"
+# oreg_url is defined by user input
+oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
 oreg_auth_credentials_path: "{{ r_openshift_master_data_dir }}/.docker"
 oreg_auth_credentials_replace: False
 l_bind_docker_reg_auth: False

+ 2 - 2
roles/openshift_node/defaults/main.yml

@@ -82,8 +82,8 @@ default_r_openshift_node_os_firewall_allow:
 # Allow multiple port ranges to be added to the role
 r_openshift_node_os_firewall_allow: "{{ default_r_openshift_node_os_firewall_allow | union(openshift_node_open_ports | default([])) }}"
 
-oreg_url: ''
-oreg_host: "{{ oreg_url.split('/')[0] if '.' in oreg_url.split('/')[0] else '' }}"
+# oreg_url is defined by user input
+oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
 oreg_auth_credentials_path: "{{ openshift_node_data_dir }}/.docker"
 oreg_auth_credentials_replace: False
 l_bind_docker_reg_auth: False