Преглед на файлове

Fixed hostvar access for bird config and gre tunnel config

Till Klocke преди 9 години
родител
ревизия
a95ef31971

+ 3 - 3
roles/internal/ffdo.mesh-interfaces/templates/bird.conf.j2

@@ -3,10 +3,10 @@
 #
 
 {% for host in hostvars %}
-{% if host['ansible_fqdn'] != ansible_fqdn %}
-protocol bgp {{host['ansible_hostname']}} from ibgp {
+{% if hostvars[host]['ansible_fqdn'] != ansible_fqdn %}
+protocol bgp {{hostvars[host]['ansible_hostname']}} from ibgp {
         source address {{mesh_ipv4|ipaddr('address')}};
-        neighbor {{host.mesh_ipv4}} as {{supernode_as}};
+        neighbor {{hostvars[host]['mesh_ipv4']}} as {{supernode_as}};
         default bgp_med 4;
 };
 {% endif %}

+ 2 - 2
roles/internal/ffdo.mesh-interfaces/templates/bird6.conf.j2

@@ -3,8 +3,8 @@
 #
 
 {% for host in hostvars %}
-{% if host['ansible_fqdn'] != ansible_fqdn %}
-protocol bgp {{host['ansible_hostname']}} from ibgp {
+{% if hostvars[host]['ansible_fqdn'] != ansible_fqdn %}
+protocol bgp {{hostvars[host]['ansible_hostname']}} from ibgp {
         neighbor {{host.mesh_ipv6}} as {{supernode_as}};
         default bgp_med 4;
 }

+ 4 - 4
roles/internal/ffdo.mesh-interfaces/templates/gre-tunnel.j2

@@ -1,8 +1,8 @@
 {% for host in hostvars %}
-{% if host['ansible_fqdn'] != ansible_fqdn %}
-auto {{host['ansible_fqdn']}}
-iface {{host['ansible_fqdn']}} inet manual
-    pre-up ip link add $IFACE type gretap local {{ansible_default_ipv4.address}} remote {{host['ansible_default_ipv4']['address']}} dev {{ansible_default_ipv4.alias}}
+{% if hostvars[host]['ansible_fqdn'] != ansible_fqdn %}
+auto {{hostvars[host]['ansible_fqdn']}}
+iface {{hostvars[host]['ansible_fqdn']}} inet manual
+    pre-up ip link add $IFACE type gretap local {{ansible_default_ipv4.address}} remote {{hostvars[host]['ansible_default_ipv4']['address']}} dev {{ansible_default_ipv4.alias}}
     pre-up ip link set up dev $IFACE
     up batctl if add $IFACE
     post-down ip link set down dev $IFACE