„wireguard.yml“ ändern

This commit is contained in:
olli 2023-06-10 15:07:58 +02:00
parent 73d0621dca
commit 2836bd3d85

View File

@ -78,6 +78,45 @@
route: yes
interface_in: wg0
- name: Restart service for config changes
copy:
dest: "/etc/systemd/system/wg-ui-restart.service"
content: |
[Unit]
Description=Restart WireGuard
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service
[Install]
RequiredBy=wg-ui-restart.path
- name: 'start wg-ui-restart.service'
systemd:
name: wg-ui-restart.service
enabled: true
- name: Restart service for config changes
copy:
dest: "/etc/systemd/system/wg-ui-restart.path"
content: |
[Unit]
Description=Watch /etc/wireguard/wg0.conf for changes
[Path]
PathModified=/etc/wireguard/wg0.conf
[Install]
WantedBy=multi-user.target
- name: 'add wg-ui-restart.path to startup'
systemd:
name: wg-ui-restart.path
state: started
enabled: true
- name: 'add wireguard to startup'
command: systemctl enable wg-quick@wg0.service
args: