From 4f299425c6ffee8f2b1f9ecdcce890d1da33becd Mon Sep 17 00:00:00 2001 From: Shalin Patel Date: Fri, 27 Sep 2024 16:11:17 -0700 Subject: [PATCH] fix: enable installing cri-tools rpm from upstream repo (#1191) --- ansible/roles/kubeadm/tasks/redhat.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/roles/kubeadm/tasks/redhat.yaml b/ansible/roles/kubeadm/tasks/redhat.yaml index b7405eb5d..3c81bdfa4 100644 --- a/ansible/roles/kubeadm/tasks/redhat.yaml +++ b/ansible/roles/kubeadm/tasks/redhat.yaml @@ -16,14 +16,22 @@ - block: + - name: check cri-tools rpm exists locally at '/opt' + stat: + path: "/opt/{{ 'cri-tools-' + critools_rpm }}{{ '-fips' if fips.enabled else '' }}.rpm" + delegate_to: localhost + register: haslocalcritools + become: false + - name: copy cri-tools rpm copy: src: "/opt/{{ 'cri-tools-' + critools_rpm }}{{ '-fips' if fips.enabled else '' }}.rpm" dest: "/opt/{{ 'cri-tools-' + critools_rpm }}.rpm" + when: haslocalcritools.stat.exists - name: install cri-tools rpm package yum: - name: "/opt/{{ 'cri-tools-' + critools_rpm }}.rpm" + name: "{{ '/opt/' if haslocalcritools.stat.exists }}{{ 'cri-tools-' + critools_rpm }}{{'.rpm' if haslocalcritools.stat.exists }}" state: present update_cache: true enablerepo: "{{ 'offline' if offline_mode_enabled else '' }}"