]> git.somenet.org - root/pub/somesible.git/blob - roles/base/wireguard/tasks/wireguard_interface.yml
[roles/util/letsencrypt-cert] request letsencrypt-cert helper role
[root/pub/somesible.git] / roles / base / wireguard / tasks / wireguard_interface.yml
1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 ---
8 - name: copy wireguard interface {{wg}} config
9   copy:
10     src: "{{item}}"
11     dest: "/etc/wireguard/{{wg}}.conf"
12     mode: 0600
13     owner: "root"
14     group: "root"
15   with_first_found:
16     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{wg}}.conf"
17     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{wg}}.conf"
18     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{wg}}.conf"
19     - "default/{{wg}}.conf"
20   # does not work. Also register + when changed breaks the connections immediately, do not use!
21   #notify: restart wg-quick.target
22
23
24 - name: "enable and start wireguard interface wg-quick@{{wg}}.service"
25   include_role: name="base/systemd/enable-and-start"
26   vars:
27     service_name: "wg-quick@{{wg}}.service"