From af6c3dd12a73e24e4f0832ca6b43d736bd1ec6d2 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 28 Jul 2021 14:46:58 +0300 Subject: [PATCH] roles/common: Update cache in firewall playbook cron-apt updates the system against the security-only databases at night so many packages are "missing" unless you run apt update. We need to update the cache on all apt tasks actually because I might be running them by their tag and they currently only get updated at the beginning of the playbook. --- roles/common/tasks/firewall_Debian.yml | 2 +- roles/common/tasks/firewall_Ubuntu.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/common/tasks/firewall_Debian.yml b/roles/common/tasks/firewall_Debian.yml index 9b8925f..8d05b34 100644 --- a/roles/common/tasks/firewall_Debian.yml +++ b/roles/common/tasks/firewall_Debian.yml @@ -21,7 +21,7 @@ - python3-systemd - name: Install firewall packages - apt: pkg={{ debian_firewall_packages }} state=present + apt: pkg={{ debian_firewall_packages }} state=present cache_valid_time=3600 - name: Start and enable nftables when: ansible_distribution_major_version is version('11', '>=') diff --git a/roles/common/tasks/firewall_Ubuntu.yml b/roles/common/tasks/firewall_Ubuntu.yml index 2d6b920..88c64b5 100644 --- a/roles/common/tasks/firewall_Ubuntu.yml +++ b/roles/common/tasks/firewall_Ubuntu.yml @@ -26,7 +26,7 @@ - python3-systemd - name: Install firewall packages - apt: pkg={{ ubuntu_firewall_packages }} state=present + apt: pkg={{ ubuntu_firewall_packages }} state=present cache_valid_time=3600 - name: Remove ufw when: ansible_distribution_version is version('16.04', '>=')