Added peer configuration and error reponses

main
Alexander Böhm 2021-10-16 15:48:16 +02:00
parent b11647f184
commit 170a4bab7d
2 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,8 @@
secret "{{ profile.value.private_key }}";
# ansible managed
secret "{{ profile.value.private_key |mandatory('A profile required a private_key') }}";
log level {{ profile.value.log_level |d("info") }};
interface "{{ profile.value.interface |d('fastd-%s' |format(profile.key)) }}";
interface "{{ profile.value.interface |d('fastd_%s' |format(profile.key)) }}";
mode {{ profile.value.mode |d("tap") }};
mtu {{ profile.value.mtu |d("1280") }};
@ -8,12 +10,13 @@ mtu {{ profile.value.mtu |d("1280") }};
method "{{ method }}";
{% endfor %}
bind {{ profile.value.bind |d('any:10061') }};
{% if not (profile.value.verify |d(True)) %}
on verify "true";
{% if profile.value.bind |d(False) %}
bind {{ profile.value.bind }};
{% endif %}
include peers from "peers";
include peers from "{{ config_dir }}/{{ profile.key }}/peers";
{% if profile.value.additional_config |d(False) %}
{{ profile.value.additional_config }}
{% endif %}

View File

@ -1,4 +1,6 @@
key "{{ peer.value.public_key }}";
# ansible managed
key "{{ peer.value.public_key |mandatory('A public key is required for a peer') }}";
{% for remote in peer.value.remotes |d([]) %}
remote {{ remote }};