32 lines
632 B
Text
32 lines
632 B
Text
# {{ ansible_managed }}
|
|
|
|
[connection]
|
|
id={{ ifname }}
|
|
uuid={{ ansible_facts.hostname | to_uuid(namespace=ifname | to_uuid) }}
|
|
type=wireguard
|
|
autoconnect={{ autoconnect }}
|
|
interface-name={{ ifname }}
|
|
|
|
[ipv4]
|
|
method=manual
|
|
never-default=true
|
|
address1={{ address }}
|
|
dns={{ dns }}
|
|
dns-search={{ domain }}
|
|
|
|
[ipv6]
|
|
method=ignore
|
|
addr-gen-mode=stable-privacy
|
|
|
|
[wireguard]
|
|
private-key={{ private_key }}
|
|
{% for peer in peers %}
|
|
|
|
# {{ peer.note }}
|
|
[wireguard-peer.{{ peer.public_key }}]
|
|
endpoint={{ peer.endpoint }}
|
|
allowed-ips={{ peer.allowed_ips }}
|
|
{% if peer.keepalive %}
|
|
persistent-keepalive={{ peer.keepalive }}
|
|
{% endif %}
|
|
{% endfor %}
|