Browse Source

respondd: only set mesh_vpn if node has role fastd

Karsten Böddeker 7 years ago
parent
commit
f14a2aadeb
2 changed files with 8 additions and 1 deletions
  1. 5 0
      respondd/init.sls
  2. 3 1
      respondd/respondd-config.tmpl

+ 5 - 0
respondd/init.sls

@@ -55,6 +55,11 @@ ffho-respondd:
       mcast_iface: "br-{{site}}"
     {% else %}
       mcast_iface: "bat-{{site}}"
+    {% endif %}
+    {% if 'fastd' in salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', []) %}
+      mesh_vpn: [{{ site }}_intergw, {{ site }}_nodes4, {{ site }}_nodes6]
+    {% else %}
+      mesh_vpn: False
     {% endif %}
       site: {{site}}
       site_code: "{{salt['pillar.get']('nodes:' ~ grains['id'] ~ ':site_code', '')}}"

+ 3 - 1
respondd/respondd-config.tmpl

@@ -1,7 +1,9 @@
 {
   "batman": "{{ bat_iface }}",
   "bridge": "{{ mcast_iface }}",
-  "mesh-vpn": ["{{ site }}_intergw", "{{ site }}_nodes4", "{{ site }}_nodes6"],
+{%- if mesh_vpn %}
+  "mesh-vpn": ["{{ ('", "').join(mesh_vpn) }}"],
+{%- endif %}
   "nodeinfo": {
     "hostname": "{{ hostname }}",
 {%- if location %}