Commit 93728b8f authored by nanahira's avatar nanahira

new

parent 36516f9c
---
- hosts: wg
remote_user: root
tasks:
- name: config
become: true
template:
src: wireguard.conf.j2
dest: '/etc/wireguard/{{interface}}.conf'
owner: root
group: root
mode: '0600'
- name: wg-quick up
become: true
ignore_errors: true
register: wg_up_status
shell: 'wg-quick up {{interface}}'
- name: enable systemctl
become: true
ignore_errors: true
systemd:
name: 'wg-quick@{{interface}}'
state: started
- name: config for setconf
notify: setconf
template:
src: wireguard-setconf.conf.j2
dest: '/tmp/{{interface}}.conf'
when: "'already exists' in command_result.stderr"
handlers:
- name: setconf
become: true
shell: 'wg setconf {{interface}} /tmp/{{interface}}.conf'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment