summaryrefslogtreecommitdiff
path: root/data/templates/frr/rpki.frr.tmpl.j2
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-10 09:26:56 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-11 21:22:07 +0200
commitf1b031589e6c58296cdf73b975c71b10c407bdb3 (patch)
treeaea66328fffbdd9c22d39bddf0fb16248100beb0 /data/templates/frr/rpki.frr.tmpl.j2
parent02f2700d4e3742bacf534c5bd6c4118c66a18aff (diff)
downloadvyos-1x-f1b031589e6c58296cdf73b975c71b10c407bdb3.tar.gz
vyos-1x-f1b031589e6c58296cdf73b975c71b10c407bdb3.zip
T4353: enable linting of Jinja2 templates
Diffstat (limited to 'data/templates/frr/rpki.frr.tmpl.j2')
-rw-r--r--data/templates/frr/rpki.frr.tmpl.j218
1 files changed, 18 insertions, 0 deletions
diff --git a/data/templates/frr/rpki.frr.tmpl.j2 b/data/templates/frr/rpki.frr.tmpl.j2
new file mode 100644
index 000000000..9a549d6de
--- /dev/null
+++ b/data/templates/frr/rpki.frr.tmpl.j2
@@ -0,0 +1,18 @@
+!
+{# as FRR does not support deleting the entire rpki section we leave it in place even when it's empty #}
+rpki
+{% if cache is vyos_defined %}
+{% for peer, peer_config in cache.items() %}
+{# port is mandatory and preference uses a default value #}
+{% if peer_config.ssh.username is vyos_defined %}
+ rpki cache {{ peer | replace('_', '-') }} {{ peer_config.port }} {{ peer_config.ssh.username }} {{ peer_config.ssh.private_key_file }} {{ peer_config.ssh.public_key_file }} {{ peer_config.ssh.known_hosts_file }} preference {{ peer_config.preference }}
+{% else %}
+ rpki cache {{ peer | replace('_', '-') }} {{ peer_config.port }} preference {{ peer_config.preference }}
+{% endif %}
+{% endfor %}
+{% endif %}
+{% if polling_period is vyos_defined %}
+ rpki polling_period {{ polling_period }}
+{% endif %}
+exit
+!