Merge branch 'commongoodtechnology-update_cache_all'

master
githubixx 2 years ago
commit 8a3fad9859

@ -9,6 +9,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
- **BREAKING** CentOS7: Introduce `wireguard_centos7_kernel_plus_reboot` and `wireguard_centos7_standard_reboot` variables. Both are set to "true" by default. This will cause the host to be rebooted in case the "wireguard" kernel module was installed the very first time. If `wireguard_centos7_installation_method: "kernel-plus"` is set and the host wasn't booted with a `kernel-plus` kernel already you most probably need to reboot. For the `standard` kernel this might not be needed. - **BREAKING** CentOS7: Introduce `wireguard_centos7_kernel_plus_reboot` and `wireguard_centos7_standard_reboot` variables. Both are set to "true" by default. This will cause the host to be rebooted in case the "wireguard" kernel module was installed the very first time. If `wireguard_centos7_installation_method: "kernel-plus"` is set and the host wasn't booted with a `kernel-plus` kernel already you most probably need to reboot. For the `standard` kernel this might not be needed.
- CentOS7: Add reboot to the standard mode to make sure the WireGuard kernel module is available (contribution by @mofelee) - CentOS7: Add reboot to the standard mode to make sure the WireGuard kernel module is available (contribution by @mofelee)
- **BREAKING** Introduce `wireguard_update_cache` variable to control if package manager caches should be updated before the installation (contribution by @sebix). Before this release the package manager cache wasn't updated for AlmaLinux 9, Archlinux, Fedora and openSUSE. With `wireguard_update_cache` set to `true` by default those OSes are now also update the package manager cache. If you don't want that set `wireguard_update_cache` to `false` for the host in question.
- variable `wireguard_ubuntu_update_cache` is deprecated
## 13.0.1 ## 13.0.1

@ -137,6 +137,10 @@ wireguard_interface_restart: false
# course a very sensitive value you might consider a tool like Ansible Vault # course a very sensitive value you might consider a tool like Ansible Vault
# to store it encrypted. # to store it encrypted.
# wireguard_private_key: # wireguard_private_key:
# Set to "false" if package cache should not be updated (only relevant if
# the package manager in question supports this option)
wireguard_update_cache: "true"
``` ```
There are also a few Linux distribution specific settings: There are also a few Linux distribution specific settings:
@ -148,8 +152,9 @@ There are also a few Linux distribution specific settings:
# - elementary OS # - elementary OS
####################################### #######################################
# Set to "false" if package cache should not be updated # DEPRECATED: Please use "wireguard_update_cache" instead.
wireguard_ubuntu_update_cache: "true" # Set to "false" if package cache should not be updated.
wireguard_ubuntu_update_cache: "{{ wireguard_update_cache }}"
# Set package cache valid time # Set package cache valid time
wireguard_ubuntu_cache_valid_time: "3600" wireguard_ubuntu_cache_valid_time: "3600"

@ -67,14 +67,19 @@ wireguard_interface_restart: false
# If not set, a new one is generated on a blank configuration. # If not set, a new one is generated on a blank configuration.
# wireguard_private_key: # wireguard_private_key:
# Set to "false" if package cache should not be updated (only relevant if
# the package manager in question supports this option)
wireguard_update_cache: "true"
####################################### #######################################
# Settings only relevant for: # Settings only relevant for:
# - Ubuntu # - Ubuntu
# - elementary OS # - elementary OS
####################################### #######################################
# Set to "false" if package cache should not be updated # DEPRECATED: Please use "wireguard_update_cache" instead.
wireguard_ubuntu_update_cache: "true" # Set to "false" if package cache should not be updated.
wireguard_ubuntu_update_cache: "{{ wireguard_update_cache }}"
# Set package cache valid time # Set package cache valid time
wireguard_ubuntu_cache_valid_time: "3600" wireguard_ubuntu_cache_valid_time: "3600"

@ -1,5 +1,5 @@
--- ---
# Copyright (C) 2021-2022 Robert Wimmer # Copyright (C) 2021-2023 Robert Wimmer
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- hosts: opensuse - hosts: opensuse
@ -26,6 +26,9 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
- name: Updating pacman cache
raw: pacman -Sy
- name: Install Python - name: Install Python
ansible.builtin.raw: | ansible.builtin.raw: |
pacman -S --noconfirm python pacman -S --noconfirm python

@ -7,7 +7,7 @@
name: name:
- epel-release - epel-release
- elrepo-release - elrepo-release
update_cache: true update_cache: "{{ wireguard_update_cache }}"
- name: (AlmaLinux 8) Ensure WireGuard DKMS package is removed - name: (AlmaLinux 8) Ensure WireGuard DKMS package is removed
ansible.builtin.yum: ansible.builtin.yum:

@ -6,3 +6,4 @@
ansible.builtin.yum: ansible.builtin.yum:
name: wireguard-tools name: wireguard-tools
state: present state: present
update_cache: "{{ wireguard_update_cache }}"

@ -2,6 +2,10 @@
# Copyright (C) 2018-2022 Robert Wimmer # Copyright (C) 2018-2022 Robert Wimmer
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: (Archlinux) Refresh the master package lists
community.general.pacman:
update_cache: "{{ wireguard_update_cache }}"
- name: (Archlinux) Install wireguard-tools package - name: (Archlinux) Install wireguard-tools package
community.general.pacman: community.general.pacman:
name: wireguard-tools name: wireguard-tools

@ -11,12 +11,12 @@
name: name:
- epel-release - epel-release
- https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm - 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 - name: (CentOS 7) Install yum-plugin-elrepo
ansible.builtin.yum: ansible.builtin.yum:
name: yum-plugin-elrepo name: yum-plugin-elrepo
update_cache: true update_cache: "{{ wireguard_update_cache }}"
- name: (CentOS 7) Install WireGuard packages - name: (CentOS 7) Install WireGuard packages
ansible.builtin.yum: ansible.builtin.yum:
@ -48,7 +48,7 @@
name: name:
- epel-release - epel-release
- yum-utils - yum-utils
update_cache: true update_cache: "{{ wireguard_update_cache }}"
- name: (CentOS 7 - kernel-plus) Enable CentosPlus repo - name: (CentOS 7 - kernel-plus) Enable CentosPlus repo
ansible.builtin.command: yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save ansible.builtin.command: yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save

@ -6,7 +6,7 @@
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main" repo: "deb http://deb.debian.org/debian buster-backports main"
state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}" state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}"
update_cache: true update_cache: "{{ wireguard_update_cache }}"
- name: (Proxmox lxc) Install wireguard-tools. - name: (Proxmox lxc) Install wireguard-tools.
ansible.builtin.apt: ansible.builtin.apt:

@ -8,7 +8,7 @@
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main" repo: "deb http://deb.debian.org/debian buster-backports main"
state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}" 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 - name: (Proxmox) Install kernel headers for the currently running kernel to compile WireGuard with DKMS
ansible.builtin.apt: ansible.builtin.apt:

@ -27,7 +27,7 @@
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main" repo: "deb http://deb.debian.org/debian buster-backports main"
state: present state: present
update_cache: true update_cache: "{{ wireguard_update_cache }}"
- name: (Raspbian) Install latest kernel - name: (Raspbian) Install latest kernel
ansible.builtin.apt: ansible.builtin.apt:

@ -8,3 +8,4 @@
name: name:
- "wireguard" - "wireguard"
state: present state: present
update_cache: "{{ wireguard_update_cache }}"

@ -1,5 +1,6 @@
--- ---
# Copyright (C) 2020 Ties de Kock # Copyright (C) 2020 Ties de Kock
# Copyright (C) 2023 Robert Wimmer
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: (Fedora) Install WireGuard packages - name: (Fedora) Install WireGuard packages
@ -7,3 +8,4 @@
name: name:
- "wireguard-tools" - "wireguard-tools"
state: present state: present
update_cache: "{{ wireguard_update_cache }}"

@ -7,3 +7,4 @@
name: name:
- "wireguard-tools" - "wireguard-tools"
state: present state: present
update_cache: "{{ wireguard_update_cache }}"

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

@ -6,3 +6,4 @@
ansible.builtin.yum: ansible.builtin.yum:
name: wireguard-tools name: wireguard-tools
state: present state: present
update_cache: "{{ wireguard_update_cache }}"

Loading…
Cancel
Save