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].
unmanaged-hosts
Jürgen Hötzel 5 years ago committed by GitHub
parent 13621d4d68
commit 04843b5394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,14 +4,20 @@
- include_tasks: "setup-{{ ansible_distribution|lower }}.yml" - 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 - name: Install WireGuard
package: package:
name: "{{ packages }}" name: "{{ packages }}"
state: present state: present
vars:
packages:
- wireguard-dkms
- wireguard-tools
tags: tags:
- wg-install - wg-install

@ -1,11 +1,23 @@
--- ---
- name: Install required packages - name: Install wireguard-lts package
pacman: pacman:
name: "{{ packages }}" name: "{{ item.name }}"
state: present state: "{{ item.state }}"
with_items:
- { name: wireguard-dkms, state: absent }
- { name: wireguard-lts, state: present }
become: yes become: yes
vars:
packages:
- linux-headers
tags: tags:
- wg-install - 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', '<')

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

@ -0,0 +1,3 @@
packages:
- wireguard-dkms
- wireguard-tools
Loading…
Cancel
Save