From fe036cbe7705d6dc5aed5ddccb32a4723c31c9cd Mon Sep 17 00:00:00 2001 From: Kuldip Madnani Date: Wed, 6 Dec 2017 03:00:41 -0600 Subject: [PATCH] Adding changes to handle updation of yum Management cache in rhel. (#2026) * Adding changes to handle updation of yum cache in rhel. * Removed the redundant spaces --- roles/kubernetes/preinstall/tasks/main.yml | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/preinstall/tasks/main.yml b/roles/kubernetes/preinstall/tasks/main.yml index 67648c6ae..b06273445 100644 --- a/roles/kubernetes/preinstall/tasks/main.yml +++ b/roles/kubernetes/preinstall/tasks/main.yml @@ -117,9 +117,35 @@ delay: "{{ retry_stagger | random + 3 }}" when: - ansible_pkg_mgr == 'yum' + - ansible_distribution != 'RedHat' - not is_atomic - tags: - - bootstrap-os + tags: bootstrap-os + +- name: Expire management cache (YUM) for Updation - Redhat + shell: yum clean expire-cache + register: expire_cache_output + until: expire_cache_output|succeeded + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + when: + - ansible_pkg_mgr == 'yum' + - ansible_distribution == 'RedHat' + - not is_atomic + tags: bootstrap-os + +- name: Update package management cache (YUM) - Redhat + shell: yum makecache + register: make_cache_output + until: make_cache_output|succeeded + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + when: + - ansible_pkg_mgr == 'yum' + - ansible_distribution == 'RedHat' + - expire_cache_output.rc == 0 + - not is_atomic + tags: bootstrap-os + - name: Install latest version of python-apt for Debian distribs apt: