26 lines
576 B
YAML
26 lines
576 B
YAML
# install_wireguard.yml - Install WireGuard on Linux hosts
|
|
---
|
|
- name: Install WireGuard on Debian/Ubuntu
|
|
ansible.builtin.apt:
|
|
name:
|
|
- wireguard
|
|
- wireguard-tools
|
|
state: present
|
|
update_cache: true
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: Install WireGuard on RHEL/CentOS 8+
|
|
ansible.builtin.yum:
|
|
name:
|
|
- wireguard-tools
|
|
state: present
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
- name: Enable IP forwarding
|
|
ansible.posix.sysctl:
|
|
name: net.ipv4.ip_forward
|
|
value: '1'
|
|
sysctl_set: true
|
|
state: present
|
|
reload: true
|