From c56add05038c11817e43e8fc234c39af5dcf01c8 Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Wed, 29 Nov 2023 17:49:30 +0100 Subject: [PATCH] apt is too dumb --- README.md | 2 +- tasks/apt_cache.yml | 5 +++++ tasks/main.yml | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tasks/apt_cache.yml diff --git a/README.md b/README.md index 75b7b6d..3689783 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This role puts your server behind Cloudflare. Two options are supported: - HTTPS traffic is allowed in the new `cloudflare` zone in firewalld, which is restricted to Cloudflare's servers as described on their [IP Ranges](https://www.cloudflare.com/ips/) page. -- Cloudflare Tunnel is installed on the service with the token provided. In this +- Cloudflare Tunnel is installed on the server with the token provided. In this case, you need to configure your tunnel in the Cloudflare dashboard to select which services to be allowed. diff --git a/tasks/apt_cache.yml b/tasks/apt_cache.yml new file mode 100644 index 0000000..11e6d2c --- /dev/null +++ b/tasks/apt_cache.yml @@ -0,0 +1,5 @@ +--- +- name: Update apt cache + apt: + update_cache: true + register: noobient_apt_cache_updated diff --git a/tasks/main.yml b/tasks/main.yml index ac67452..8431218 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,7 @@ --- +- include_tasks: apt_cache.yml + when: ansible_pkg_mgr == 'apt' and noobient_apt_cache_updated is not defined + - include_tasks: https.yml when: mode == 'https'