wireguard-ui/tasks/RedHat/wireguard_install.yaml

55 lines
1.2 KiB
YAML
Raw Normal View History

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
- name: Install wireguard for RHEL 8
when: ansible_facts['distribution_major_version'] == '8'
block:
- name: Install repos
dnf:
name:
- elrepo-release
- epel-release
state: present
2022-07-13 12:27:32 +00:00
- name: Install wireguard packages
dnf:
name:
- kmod-wireguard
- wireguard-tools
2022-07-13 15:25:58 +00:00
state: present
- name: Install wireguard for RHEL 9
when: ansible_facts['distribution_major_version'] == '9'
block:
- name: Install wireguard packages
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