Skip to content

Commit 19a3fb2

Browse files
committed
Check if oc exists before downloading it
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
1 parent 5c00268 commit 19a3fb2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ansible/roles/ocp-release/tasks/payload_url.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121
bastion_rhel_version: "rhel8"
2222
when: ansible_facts['distribution_major_version'] is version('8', '==')
2323

24+
- name: Check if oc exists
25+
stat:
26+
path: /usr/local/bin/oc
27+
register: oc_exists
28+
2429
- name: Get latest stable Openshift client
2530
shell: curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-amd64-{{ bastion_rhel_version}}.tar.gz | tar xz -C /usr/local/bin/ oc
31+
when: not oc_exists.stat.exists
2632

2733
- name: Get release info
2834
command: oc adm release info {{ payload_url }}

0 commit comments

Comments
 (0)