mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Fix token based openshift logins
This commit is contained in:
parent
8ad46436df
commit
c39370dbd0
@ -10,6 +10,7 @@ dockerhub_base=ansible
|
||||
|
||||
# Openshift Install
|
||||
# Will need to set -e openshift_password=developer -e docker_registry_password=$(oc whoami -t)
|
||||
# or set -e openshift_token=TOKEN
|
||||
# openshift_host=127.0.0.1:8443
|
||||
# openshift_project=awx
|
||||
# openshift_user=developer
|
||||
|
||||
@ -23,12 +23,29 @@
|
||||
- openshift_user is defined
|
||||
- openshift_password is defined
|
||||
- openshift_token is not defined
|
||||
register: openshift_auth_result
|
||||
ignore_errors: true
|
||||
no_log: true
|
||||
|
||||
- name: OpenShift authentication failed on TLS verification
|
||||
fail:
|
||||
msg: "Failed to verify TLS, consider settings openshift_skip_tls_verify=True {{ openshift_auth_result.stderr }}"
|
||||
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")
|
||||
|
||||
- name: Authenticate with OpenShift via token
|
||||
shell: |
|
||||
{{ openshift_oc_bin }} login {{ openshift_host }} \
|
||||
--token {{ openshift_token }} \
|
||||
--insecure-skip-tls-verify={{ openshift_skip_tls_verify | default(false) | bool }}
|
||||
when: openshift_token is defined
|
||||
register: openshift_auth_result
|
||||
ignore_errors: true
|
||||
no_log: true
|
||||
|
||||
- name: OpenShift authentication failed
|
||||
fail:
|
||||
msg: "{{ openshift_auth_result.stderr }}"
|
||||
when: openshift_auth_result.rc != 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user