collection of ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
ansible-roles/common/wireguard/templates/30-wg0.netdev.jinja2

21 lines
461 B

[NetDev]
Name = {{ wg_if }}
Kind = wireguard
Description = {{ wg_desc }}
[WireGuard]
PrivateKey = {{ wg_private_key.stdout_lines[0] }}
ListenPort = {{ wg_port }}
{% if wg_peers is defined %}
{% for wg_peer in wg_peers %}
[WireGuardPeer]
PublicKey = {{ wg_peer.pubkey }}
{% for net in wg_peer.allowed_nets %}
AllowedIPs = {{ net }}
{% endfor %}
{% if wg_peer.ip is defined %}
Endpoint = {{ wg_peer.ip }}:{{ wg_peer.port }}
{% endif %}
{% endfor %}
{% endif %}