3
0
Fork 0
This repository has been archived on 2020-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-role-wireguard/tasks/setup-ubuntu.yml

49 lines
1.2 KiB
YAML

---
- name: (Ubuntu) Update APT package cache
apt:
update_cache: "{{ wireguard_ubuntu_update_cache }}"
cache_valid_time: "{{ wireguard_ubuntu_cache_valid_time }}"
tags:
- wg-install
- block:
- name: (Ubuntu) Install support packages needed for Wireguard (for Ubuntu < 19.10)
package:
name: "{{ packages }}"
state: present
vars:
packages:
- software-properties-common
- linux-headers-{{ ansible_kernel }}
tags:
- wg-install
- name: (Ubuntu) Add WireGuard repository (for Ubuntu < 19.10)
apt_repository:
repo: "ppa:wireguard/wireguard"
state: present
update_cache: yes
tags:
- wg-install
- name: (Ubuntu) Install wireguard packages (for Ubuntu < 19.10)
apt:
name:
- "wireguard-dkms"
- "wireguard-tools"
state: present
tags:
- wg-install
when:
- ansible_lsb.major_release is version('19.10', '<')
- block:
- name: (Ubuntu) Install wireguard-tools package (for Ubuntu > 19.04)
apt:
name: "wireguard-tools"
state: present
tags:
- wg-install
when:
- ansible_lsb.major_release is version('19.04', '>')