From f34679bf3bdc6fcb4c7f6dcedb5427865bc8a67c Mon Sep 17 00:00:00 2001 From: therojam Date: Wed, 11 Nov 2020 00:39:13 +0100 Subject: [PATCH 1/4] ++ steps to update the repo caches of deb/rh sys --- tasks/packages.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tasks/packages.yml b/tasks/packages.yml index 70934fc..e4253b7 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -1,4 +1,19 @@ --- +- name: update repo-cache for debian/ubuntu + become: true + apt: + update_cache: yes + cache_valid_time: 3600 + when: + ansible_os_family == 'Debian' + +- name: update repo-cache for debian/ubuntu + become: true + dnf: + update_cache: yes + when: + ansible_os_family == 'RedHat' + - name: install base packages for all operating systems become: true package: From 3cabf468f90675f6f0c6779d6adc7dd406debbd7 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 11 Nov 2020 01:23:46 +0100 Subject: [PATCH 2/4] remove trailing whitespace --- tasks/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/packages.yml b/tasks/packages.yml index e4253b7..5d2bfc1 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -3,7 +3,7 @@ become: true apt: update_cache: yes - cache_valid_time: 3600 + cache_valid_time: 3600 when: ansible_os_family == 'Debian' From a6bb39eb3265242b9d416f926f5d5ad45a7ca04a Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 11 Nov 2020 11:00:11 +0100 Subject: [PATCH 3/4] limit to and ansible_distribution_version >= 8 --- tasks/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/packages.yml b/tasks/packages.yml index 5d2bfc1..6514dfb 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -12,7 +12,7 @@ dnf: update_cache: yes when: - ansible_os_family == 'RedHat' + ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 8 or - name: install base packages for all operating systems become: true From 7c4ca9b11a631605229eb7da550414b0c327efb4 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 11 Nov 2020 11:11:17 +0100 Subject: [PATCH 4/4] fix my typo --- tasks/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/packages.yml b/tasks/packages.yml index 6514dfb..0ef442a 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -12,7 +12,7 @@ dnf: update_cache: yes when: - ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 8 or + - ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 8 - name: install base packages for all operating systems become: true