You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-wireguard/tasks/setup-ubuntu.yml

33 lines
923 B
YAML

---
# Copyright (C) 2018-2020 Robert Wimmer
# SPDX-License-Identifier: GPL-3.0-or-later
- name: (Ubuntu) Update APT package cache
ansible.builtin.apt:
update_cache: "{{ wireguard_ubuntu_update_cache }}"
cache_valid_time: "{{ wireguard_ubuntu_cache_valid_time }}"
- name: (Ubuntu) Tasks for Ubuntu < 19.10
block:
- name: (Ubuntu) Install support packages needed for Wireguard (for Ubuntu < 19.10)
ansible.builtin.package:
name: "{{ packages }}"
state: present
vars:
packages:
- software-properties-common
- linux-headers-{{ ansible_kernel }}
when:
- ansible_lsb.major_release is version('19.10', '<')
- name: (Ubuntu) Ensure WireGuard DKMS package is removed
ansible.builtin.apt:
name:
- "wireguard-dkms"
state: absent
- name: (Ubuntu) Install wireguard package
ansible.builtin.apt:
name: "wireguard"
state: present