„wireguard.yml“ ändern
This commit is contained in:
parent
73d0621dca
commit
2836bd3d85
@ -78,6 +78,45 @@
|
|||||||
route: yes
|
route: yes
|
||||||
interface_in: wg0
|
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'
|
- name: 'add wireguard to startup'
|
||||||
command: systemctl enable wg-quick@wg0.service
|
command: systemctl enable wg-quick@wg0.service
|
||||||
args:
|
args:
|
||||||
|
Loading…
Reference in New Issue
Block a user