Merge pull request #2416 from fantashley/fix-openshift-auth

Fix openshift auth broken by undefined vars

Reviewed-by: Ashley Nelson <fantashley@gmail.com>
             https://github.com/fantashley
This commit is contained in:
softwarefactory-project-zuul[bot]
2018-10-11 21:51:20 +00:00
committed by GitHub

View File

@@ -29,11 +29,16 @@
- name: OpenShift authentication failed on TLS verification
fail:
msg: "Failed to verify TLS, consider settings openshift_skip_tls_verify=True {{ openshift_auth_result.stderr }}"
msg: "Failed to verify TLS, consider settings openshift_skip_tls_verify=True {{ openshift_auth_result.stderr | default('certificate does not match hostname') }}"
when:
- openshift_skip_tls_verify is not defined or not openshift_skip_tls_verify
- openshift_auth_result.rc != 0
- openshift_auth_result.stderr | search("certificate that does not match its hostname")
- openshift_auth_result.rc is defined and openshift_auth_result.rc != 0
- openshift_auth_result.stderr is defined and (openshift_auth_result.stderr | search("certificate that does not match its hostname"))
- name: OpenShift authentication failed
fail:
msg: "{{ openshift_auth_result.stderr | default('Invalid credentials') }}"
when: openshift_auth_result.rc is defined and openshift_auth_result.rc != 0
- name: Authenticate with OpenShift via token
shell: |
@@ -47,5 +52,6 @@
- name: OpenShift authentication failed
fail:
msg: "{{ openshift_auth_result.stderr }}"
when: openshift_auth_result.rc != 0
msg: "{{ openshift_auth_result.stderr | default('Invalid token') }}"
when: openshift_auth_result.rc is defined and openshift_auth_result.rc != 0