dotfiles/roles/wg/tasks/install.yml
Matej Focko e3bff6c8c4
fix(install): refine the decision-making for OSs
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-11-18 15:15:49 +01:00

23 lines
594 B
YAML

---
- name: Set default packages for wireguard
ansible.builtin.set_fact:
wg_packages:
- wireguard-tools
- name: Set packages for wireguard on Debian-based OSs
ansible.builtin.set_fact:
wg_packages:
- wireguard
when: ansible_distribution in [ "Debian", "Ubuntu" ]
- name: Set packages for wireguard on archLinux
ansible.builtin.set_fact:
wg_packages:
- wireguard
- systemd-resolveconf
when: ansible_distribution == "Archlinux"
- name: Install wireguard and dependencies
ansible.builtin.package:
name: "{{ wg_packages }}"
state: present