--- # Copyright (C) 2018-2020 Robert Wimmer # Copyright (C) 2019-2020 Ties de Kock # SPDX-License-Identifier: GPL-3.0-or-later - name: (Debian) Add WireGuard repository on buster apt_repository: repo: "deb http://deb.debian.org/debian buster-backports main" state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}" update_cache: yes - name: (Debian) Install kernel headers for the currently running kernel to compile Wireguard with DKMS apt: name: - "linux-headers-{{ ansible_kernel }}" state: present - name: (Debian) Get architecture command: "dpkg --print-architecture" register: wireguard__fact_dpkg_arch changed_when: false check_mode: no - name: (Debian) Install kernel headers metapackage to ensure headers will be installed apt: name: - "linux-headers-{{ wireguard__fact_dpkg_arch.stdout }}" state: present when: ('-cloud-' not in ansible_kernel) - name: (Debian) Install WireGuard packages apt: name: - "wireguard" state: present