mirror of
https://gitverse.ru/kpa39l/infrastructure.git
synced 2026-09-29 18:15:02 +00:00
35 lines
700 B
YAML
35 lines
700 B
YAML
---
|
|
- name: Remove any broken Docker repository files to prevent apt errors
|
|
file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
with_fileglob:
|
|
- "/etc/apt/sources.list.d/*docker*"
|
|
ignore_errors: yes
|
|
|
|
- name: Install WireGuard
|
|
apt:
|
|
name: wireguard
|
|
state: present
|
|
update_cache: yes
|
|
ignore_errors: yes
|
|
|
|
- name: Ensure WireGuard directory exists
|
|
file:
|
|
path: /etc/wireguard
|
|
state: directory
|
|
mode: '0700'
|
|
|
|
- name: Deploy WireGuard configuration
|
|
template:
|
|
src: wg0.conf.j2
|
|
dest: /etc/wireguard/wg0.conf
|
|
mode: '0600'
|
|
notify: Restart WireGuard
|
|
|
|
- name: Enable and start WireGuard service
|
|
systemd:
|
|
name: wg-quick@wg0
|
|
enabled: yes
|
|
state: started
|