3
0
Fork 0

Use Arch Linux specific package list (#48)

Arch Linux ships a Linux kernel > 5.6 and doesn't require DKMS.

Move the package list variable to (distribution-specific) var files.

For the Arch Linux LTS kernel (5.4) a binary wireguard-lts package is
provided in [core].
This commit is contained in:
Jürgen Hötzel 2020-05-02 21:12:34 +02:00 committed by GitHub
parent 13621d4d68
commit 04843b5394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 10 deletions

View File

@ -4,14 +4,20 @@
- include_tasks: "setup-{{ ansible_distribution|lower }}.yml"
- name: Load packages variable file based on the OS type, or a default if not found
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "packages-{{ ansible_distribution | lower }}.yml"
- "packages.yml"
paths:
- "vars"
- name: Install WireGuard
package:
name: "{{ packages }}"
state: present
vars:
packages:
- wireguard-dkms
- wireguard-tools
tags:
- wg-install

View File

@ -1,11 +1,23 @@
---
- name: Install required packages
- name: Install wireguard-lts package
pacman:
name: "{{ packages }}"
state: present
name: "{{ item.name }}"
state: "{{ item.state }}"
with_items:
- { name: wireguard-dkms, state: absent }
- { name: wireguard-lts, state: present }
become: yes
vars:
packages:
- linux-headers
tags:
- wg-install
when:
- ansible_kernel is match(".*-lts$")
- ansible_kernel is version('5.6', '<')
- name: Install wireguard-dksm package
pacman:
name: wireguard-dkms
become: yes
tags:
- wg-install
when:
- not ansible_kernel is match(".*-lts$")
- ansible_kernel is version('5.6', '<')

View File

@ -0,0 +1,2 @@
packages:
- wireguard-tools

3
vars/packages.yml Normal file
View File

@ -0,0 +1,3 @@
packages:
- wireguard-dkms
- wireguard-tools