Skip to content

Commit

Permalink
option wireguard_update_cache to disable refresh
Browse files Browse the repository at this point in the history
previously disable the cache update was only possible on ubuntu
using the generic name wireguard_update_cache it can be enabled for all
operating systems
  • Loading branch information
sebix committed Feb 22, 2023
1 parent f6a6e46 commit ad6ce63
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ wireguard_interface_restart: false
# course a very sensitive value you might consider a tool like Ansible Vault
# to store it encrypted.
# wireguard_private_key:

# Set to "false" if package cache should not be updated
wireguard_update_cache: "true"
```
There are also a few Linux distribution specific settings:
Expand All @@ -150,9 +153,6 @@ There are also a few Linux distribution specific settings:
# - elementary OS
#######################################

# Set to "false" if package cache should not be updated
wireguard_ubuntu_update_cache: "true"

# Set package cache valid time
wireguard_ubuntu_cache_valid_time: "3600"

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ wireguard_interface_restart: false
#######################################

# Set to "false" if package cache should not be updated
wireguard_ubuntu_update_cache: "true"
wireguard_update_cache: "true"

# Set package cache valid time
wireguard_ubuntu_cache_valid_time: "3600"
Expand Down
2 changes: 1 addition & 1 deletion molecule/kvm-single-server/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
tasks:
- name: Update APT package cache
ansible.builtin.apt:
update_cache: true
update_cache: "{{ wireguard_update_cache }}"
cache_valid_time: 3600
2 changes: 1 addition & 1 deletion molecule/kvm/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
tasks:
- name: Update APT package cache
ansible.builtin.apt:
update_cache: true
update_cache: "{{ wireguard_update_cache }}"
cache_valid_time: 3600

- hosts: el8dkms
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-almalinux-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name:
- epel-release
- elrepo-release
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (AlmaLinux 8) Ensure WireGuard DKMS package is removed
ansible.builtin.yum:
Expand Down
6 changes: 3 additions & 3 deletions tasks/setup-centos-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
name:
- epel-release
- https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (CentOS 7) Install yum-plugin-elrepo
ansible.builtin.yum:
name: yum-plugin-elrepo
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (CentOS 7) Install WireGuard packages
ansible.builtin.yum:
Expand All @@ -40,7 +40,7 @@
name:
- epel-release
- yum-utils
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (CentOS 7) Enable CentosPlus repo
ansible.builtin.command: yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-debian-pve-guest-variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}"
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Proxmox lxc) Install wireguard-tools.
ansible.builtin.apt:
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-debian-pve-host-variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}"
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Proxmox) Install kernel headers for the currently running kernel to compile WireGuard with DKMS
ansible.builtin.apt:
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-debian-raspbian-buster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: present
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Raspbian) Install latest kernel
ansible.builtin.apt:
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-debian-vanilla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: present
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Debian) Install kernel headers for the currently running kernel to compile Wireguard with DKMS
ansible.builtin.apt:
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-elementary os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- name: (elementary OS) Update APT package cache
ansible.builtin.apt:
update_cache: "{{ wireguard_ubuntu_update_cache }}"
update_cache: "{{ wireguard_update_cache }}"
cache_valid_time: "{{ wireguard_ubuntu_cache_valid_time }}"

- name: (elementary OS) Install wireguard package
Expand Down
4 changes: 2 additions & 2 deletions tasks/setup-rocky-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name:
- epel-release
- elrepo-release
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Rocky Linux 8) Ensure WireGuard DKMS package is removed
ansible.builtin.yum:
Expand Down Expand Up @@ -40,7 +40,7 @@
ansible.builtin.yum:
name:
- epel-release
update_cache: true
update_cache: "{{ wireguard_update_cache }}"

- name: (Rocky Linux 8) Ensure WireGuard KMOD package is removed
ansible.builtin.yum:
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- name: (Ubuntu) Update APT package cache
ansible.builtin.apt:
update_cache: "{{ wireguard_ubuntu_update_cache }}"
update_cache: "{{ wireguard_update_cache }}"
cache_valid_time: "{{ wireguard_ubuntu_cache_valid_time }}"

- name: (Ubuntu) Tasks for Ubuntu < 19.10
Expand Down

0 comments on commit ad6ce63

Please sign in to comment.