summaryrefslogtreecommitdiff
path: root/roles/ipsec_route_based/vars/main.yml
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-10-05 20:56:05 +1000
committeromnom62 <omnom62@outlook.com>2026-10-05 20:56:05 +1000
commit8ee802e41374942965b6b93cfb4534725ef45145 (patch)
treeef3e5579bd767422caa6fe77cea6a7b5d2d8562c /roles/ipsec_route_based/vars/main.yml
parent748df2bc1d35fa285dd3fe46916e1230408778c7 (diff)
downloadvyos.blueprints-main.tar.gz
vyos.blueprints-main.zip
T9393: new rolesmain
Diffstat (limited to 'roles/ipsec_route_based/vars/main.yml')
-rw-r--r--roles/ipsec_route_based/vars/main.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/ipsec_route_based/vars/main.yml b/roles/ipsec_route_based/vars/main.yml
new file mode 100644
index 0000000..2db5c62
--- /dev/null
+++ b/roles/ipsec_route_based/vars/main.yml
@@ -0,0 +1,23 @@
+---
+_ipsec_route_based_state: "{{ 'rendered' if (vyos_blueprints_render_only | default(false) | bool) else 'merged' }}"
+_ipsec_route_based_ospf: "{{ ipsec_route_based_ospf | default({}, true) }}"
+_ipsec_route_based_bgp: "{{ ipsec_route_based_bgp | default({}, true) }}"
+_ipsec_route_based_cli_lines: "{{ (lookup('ansible.builtin.template', 'vti_cli.j2') or '').splitlines() | select | list }}"
+# One PSK entry per psk_name; peers sharing a psk_name contribute all their ids.
+_ipsec_route_based_psks: >-
+ {%- set out = [] -%}
+ {%- set names = [] -%}
+ {%- for p in ipsec_route_based_peers -%}
+ {%- set n = p.psk_name | default(p.name ~ '-PSK') -%}
+ {%- set ids = [p.local_id | default(p.local_address), p.remote_id | default(p.remote_address)] -%}
+ {%- if n in names -%}
+ {%- set e = out[names.index(n)] -%}
+ {%- for i in ids if i not in e.id -%}{%- set _ = e.id.append(i) -%}{%- endfor -%}
+ {%- else -%}
+ {%- set e = {'name': n, 'id': ids | unique | list, 'secret': p.psk} -%}
+ {%- if p.psk_type is defined -%}{%- set _ = e.update({'secret_type': p.psk_type}) -%}{%- endif -%}
+ {%- set _ = names.append(n) -%}
+ {%- set _ = out.append(e) -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {{ out }}