summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-11-03 04:05:59 -0700
committerGitHub <noreply@github.com>2017-11-03 04:05:59 -0700
commit42b4e7da984b6f755ed773b062eec8a7d90e8d60 (patch)
tree82890524b7cbd749118dbcbac7f30202b66e2c03
parent84187cc9f4968d4dc7979a91edfe19459ab97089 (diff)
parentb09c00ddb0ec802fb19dced5b1c464aad9c6d1ea (diff)
downloadopenshift-42b4e7da984b6f755ed773b062eec8a7d90e8d60.tar.gz
openshift-42b4e7da984b6f755ed773b062eec8a7d90e8d60.tar.bz2
openshift-42b4e7da984b6f755ed773b062eec8a7d90e8d60.tar.xz
openshift-42b4e7da984b6f755ed773b062eec8a7d90e8d60.zip
Merge pull request #5989 from tbielawa/bz1506951
Automatic merge from submit-queue. CFME: Use cluster_hostname if cluster_public_hostname isn't available The CFME 'automatically add provider' playbook would fail if openshift_master_cluster_public_hostname was not defined in the inventory. Now we use that value if it is available, and fallback to using the masters 'cluster_hostname' otherwise. * Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1506951
-rw-r--r--roles/openshift_management/tasks/add_container_provider.yml14
1 files changed, 13 insertions, 1 deletions
diff --git a/roles/openshift_management/tasks/add_container_provider.yml b/roles/openshift_management/tasks/add_container_provider.yml
index 383e6edb5..50a5252cc 100644
--- a/roles/openshift_management/tasks/add_container_provider.yml
+++ b/roles/openshift_management/tasks/add_container_provider.yml
@@ -10,6 +10,18 @@
- name: Ensure OpenShift facts are loaded
openshift_facts:
+- name: Ensure we use openshift_master_cluster_public_hostname if it is available
+ set_fact:
+ l_cluster_hostname: "{{ openshift.master.cluster_public_hostname }}"
+ when:
+ - openshift.master.cluster_public_hostname is defined
+
+- name: Ensure we default to the first master if openshift_master_cluster_public_hostname is unavailable
+ set_fact:
+ l_cluster_hostname: "{{ openshift.master.cluster_hostname }}"
+ when:
+ - l_cluster_hostname is not defined
+
- name: Ensure the management SA Secrets are read
oc_serviceaccount_secret:
state: list
@@ -59,7 +71,7 @@
connection_configurations:
- authentication: {auth_key: "{{ management_bearer_token }}", authtype: bearer, type: AuthToken}
endpoint: {role: default, security_protocol: ssl-without-validation, verify_ssl: 0}
- hostname: "{{ openshift.master.cluster_public_hostname }}"
+ hostname: "{{ l_cluster_hostname }}"
name: "{{ openshift_management_project }}"
port: "{{ openshift.master.api_port }}"
type: "ManageIQ::Providers::Openshift::ContainerManager"