add missing vars to default file
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6a71faa307
commit
0ae1421e07
@ -10,5 +10,15 @@ wireguard_interface: "wg0"
|
||||
# @var:wireguard_private_key: Private key to use. If not private key is given, the role will auto-generate a new key.
|
||||
# @var:wireguard_private_key:default: $ "_unset_"
|
||||
|
||||
# @var wireguard_dns:default: $ "_unset_"
|
||||
# @var wireguard_fwmark:default: $ "_unset_"
|
||||
# @var wireguard_mtu:default: $ "_unset_"
|
||||
# @var wireguard_table:default: $ "_unset_"
|
||||
|
||||
wireguard_preup: []
|
||||
wireguard_postup: []
|
||||
wireguard_predown: []
|
||||
wireguard_postdown: []
|
||||
|
||||
wireguard_peers: []
|
||||
wireguard_peers_unmanaged: []
|
||||
|
@ -1,15 +1,16 @@
|
||||
---
|
||||
- name: Ensure dependencies are installed
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- wireguard-tools
|
||||
- block:
|
||||
- name: Ensure dependencies are installed
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- wireguard-tools
|
||||
|
||||
- name: Stat WireGuard config file
|
||||
stat:
|
||||
path: "/etc/wireguard/{{ wireguard_interface }}.conf"
|
||||
register: __wireguard_config_file
|
||||
- name: Stat WireGuard config file
|
||||
stat:
|
||||
path: "/etc/wireguard/{{ wireguard_interface }}.conf"
|
||||
register: __wireguard_config_file
|
||||
become: True
|
||||
become_user: root
|
||||
|
||||
|
@ -17,26 +17,18 @@ MTU = {{ wireguard_mtu }}
|
||||
{% if wireguard_table is defined %}
|
||||
Table = {{ wireguard_table }}
|
||||
{% endif %}
|
||||
{% if wireguard_preup is defined %}
|
||||
{% for wg_preup in wireguard_preup %}
|
||||
PreUp = {{ wg_preup }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if wireguard_postup is defined %}
|
||||
{% for wg_postup in wireguard_postup %}
|
||||
PostUp = {{ wg_postup }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if wireguard_predown is defined %}
|
||||
{% for wg_predown in wireguard_predown %}
|
||||
PreDown = {{ wg_predown }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if wireguard_postdown is defined %}
|
||||
{% for wg_postdown in wireguard_postdown %}
|
||||
PostDown = {{ wg_postdown }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
SaveConfig = false
|
||||
{% for host in wireguard_peers %}
|
||||
{% if host != inventory_hostname %}
|
||||
@ -44,8 +36,8 @@ SaveConfig = false
|
||||
[Peer]
|
||||
## {{ host }}
|
||||
PublicKey = {{ hostvars[host].__wireguard_public_key }}
|
||||
{% if hostvars[host].wireguard_allowed_ips is defined %}
|
||||
AllowedIPs = {{ hostvars[host].wireguard_allowed_ips }}
|
||||
{% if hostvars[host].wireguard_allowed_ips | length > 0 %}
|
||||
AllowedIPs = {{ hostvars[host].wireguard_allowed_ips | join(",") }}
|
||||
{% else %}
|
||||
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
|
||||
{% endif %}
|
||||
@ -67,8 +59,8 @@ PublicKey = {{ peer.public_key }}
|
||||
{% if peer.preshared_key is defined %}
|
||||
PresharedKey = {{ peer.preshared_key }}
|
||||
{% endif %}
|
||||
{% if peer.allowed_ips is defined %}
|
||||
AllowedIPs = {{ peer.allowed_ips }}
|
||||
{% if peer.allowed_ips | length > 0 %}
|
||||
AllowedIPs = {{ peer.allowed_ips | join(",") }}
|
||||
{% endif %}
|
||||
{% if peer.endpoint is defined %}
|
||||
Endpoint = {{ peer.endpoint }}
|
||||
|
Loading…
Reference in New Issue
Block a user