Skip to content

Commit

Permalink
Merge pull request #152 from rayashworth/update-ocp-login
Browse files Browse the repository at this point in the history
update login with kubeconfig location
  • Loading branch information
rayashworth committed May 25, 2021
2 parents 795820f + 911d1c0 commit ee34831
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/roles/ocp_login/tasks/ocp_login.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
---
- name: "Create kube directory..."
file:
path: "{{ ocp_api_url }}/.kube"
state: directory
mode: 0755

- name: "OCP login"
command: 'oc login -u "{{ kubeadmin_user }}" -p "{{ kubeadmin_password }}" https://"{{ ocp_api_url }}:{{ ocp_api_port }}" --insecure-skip-tls-verify=true'
environment:
PATH: ".:{{ ansible_env.PATH }}"
KUBECONFIG: "{{ ocp_api_url }}/.kube/config"
register: results
until: results.stdout.find("projects") != -1
retries: "{{ login_retries }}"
Expand Down

0 comments on commit ee34831

Please sign in to comment.