diff options
author | Tim Bielawa <tbielawa@redhat.com> | 2017-11-02 10:25:51 -0400 |
---|---|---|
committer | Tim Bielawa <tbielawa@redhat.com> | 2017-11-02 11:17:43 -0400 |
commit | b09c00ddb0ec802fb19dced5b1c464aad9c6d1ea (patch) | |
tree | 365454c14ea404c9e963fe781e308d7fee91d74d | |
parent | 5bfc68706be9127199a3f3f06e04588720ed50f5 (diff) | |
download | openshift-b09c00ddb0ec802fb19dced5b1c464aad9c6d1ea.tar.gz openshift-b09c00ddb0ec802fb19dced5b1c464aad9c6d1ea.tar.bz2 openshift-b09c00ddb0ec802fb19dced5b1c464aad9c6d1ea.tar.xz openshift-b09c00ddb0ec802fb19dced5b1c464aad9c6d1ea.zip |
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.yml | 14 |
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" |