2022-07-13 15:25:58 +00:00
|
|
|
- name: Install wireguard for RHEL 7
|
|
|
|
when: ansible_facts['distribution_major_version'] == '7'
|
|
|
|
block:
|
|
|
|
- name: Install repos
|
|
|
|
yum:
|
|
|
|
name:
|
|
|
|
- elrepo-release
|
|
|
|
- epel-release
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Install wireguard packages
|
|
|
|
yum:
|
|
|
|
name:
|
|
|
|
- yum-plugin-elrepo
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Install wireguard packages
|
|
|
|
yum:
|
|
|
|
name:
|
|
|
|
- kmod-wireguard
|
|
|
|
- wireguard-tools
|
|
|
|
state: present
|
|
|
|
|
2022-07-13 15:09:24 +00:00
|
|
|
- name: Install wireguard for RHEL 8
|
2022-07-13 15:11:27 +00:00
|
|
|
when: ansible_facts['distribution_major_version'] == '8'
|
2022-07-13 15:09:24 +00:00
|
|
|
block:
|
|
|
|
- name: Install repos
|
|
|
|
dnf:
|
|
|
|
name:
|
|
|
|
- elrepo-release
|
|
|
|
- epel-release
|
|
|
|
state: present
|
2022-07-13 12:27:32 +00:00
|
|
|
|
2022-07-13 15:12:56 +00:00
|
|
|
- name: Install wireguard packages
|
2022-07-13 15:09:24 +00:00
|
|
|
dnf:
|
|
|
|
name:
|
|
|
|
- kmod-wireguard
|
|
|
|
- wireguard-tools
|
2022-07-13 15:25:58 +00:00
|
|
|
state: present
|
2022-07-13 15:09:24 +00:00
|
|
|
|
|
|
|
- name: Install wireguard for RHEL 9
|
2022-07-13 15:11:27 +00:00
|
|
|
when: ansible_facts['distribution_major_version'] == '9'
|
2022-07-13 15:09:24 +00:00
|
|
|
block:
|
2022-07-13 15:12:56 +00:00
|
|
|
- name: Install wireguard packages
|
2022-07-13 15:09:24 +00:00
|
|
|
dnf:
|
|
|
|
name:
|
|
|
|
- wireguard-tools
|
|
|
|
state: present
|
2022-07-13 13:00:25 +00:00
|
|
|
|
|
|
|
- name: Enable wg-quick systemd unit
|
|
|
|
systemd:
|
2023-03-10 13:18:46 +00:00
|
|
|
name: wg-quick@{{ wireguard_ui_combined_env['WGUI_CONFIG_FILE_PATH'] | basename | split('.') | first }}
|
2022-07-13 13:00:25 +00:00
|
|
|
enabled: yes
|
|
|
|
daemon_reload: yes
|