|
@@ -10,7 +10,7 @@
|
|
|
{%- endif %}
|
|
|
{%- set ospf_config = salt['ffho_net.get_ospf_config'](node_config, grains['id']) %}
|
|
|
|
|
|
-{%- if proto == 'v6' %}
|
|
|
+{%- if AF == 6 %}
|
|
|
# Bloody workaround for bird6's unwillingness to read !LL IPv6 addresses from lo
|
|
|
protocol direct lo_v6 {
|
|
|
interface "lo";
|
|
@@ -19,7 +19,7 @@ protocol direct lo_v6 {
|
|
|
|
|
|
protocol ospf IGP {
|
|
|
import all;
|
|
|
-{%- if proto == 'v4' %}
|
|
|
+{%- if AF == 4 %}
|
|
|
{%- if grains['id'].startswith ('cr') %}
|
|
|
export filter {
|
|
|
if net = 0.0.0.0/0 then {
|
|
@@ -32,7 +32,7 @@ protocol ospf IGP {
|
|
|
{%- else %}
|
|
|
export none;
|
|
|
{%- endif %}
|
|
|
-{%- elif proto == 'v6' %}
|
|
|
+{%- elif AF == 6 %}
|
|
|
export filter {
|
|
|
{%- if grains['id'].startswith ('cr') %}
|
|
|
if net = ::/0 then {
|
|
@@ -59,6 +59,9 @@ protocol ospf IGP {
|
|
|
|
|
|
{%- for iface in ospf_config.get(0, {})|sort %}
|
|
|
{%- set config = ospf_config[0][iface] %}
|
|
|
+ {%- if config.get('AF', AF) != AF %}
|
|
|
+ {%- continue %}
|
|
|
+ {%- endif %}
|
|
|
|
|
|
{#- Interface description? #}
|
|
|
{%- set desc = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':ifaces:' ~ iface ~ ':desc', "") %}
|
|
@@ -68,7 +71,7 @@ protocol ospf IGP {
|
|
|
{%- if 'desc' in config %}
|
|
|
# {{ config.get ('desc') }}
|
|
|
{%- endif %}
|
|
|
- {%- for attr in config|sort if attr not in ['desc'] %}
|
|
|
+ {%- for attr in config|sort if attr not in ['desc', 'AF'] %}
|
|
|
{%- set value = config.get (attr) %}
|
|
|
{#- 'is bool' only introduced in Jinja 2.11 #}
|
|
|
{%- if salt['ffho.is_bool'](value) %}
|
|
@@ -95,7 +98,7 @@ protocol ospf IGP {
|
|
|
{%- endfor %}
|
|
|
{%- for interface, iface_config in interfaces.items()|sort %}
|
|
|
interface "{{ interface }}" {
|
|
|
- {%- if interface.startswith ('ovpn-er-') and not 'yni' in interface and proto == 'v6' %}
|
|
|
+ {%- if interface.startswith ('ovpn-er-') and not 'yni' in interface and AF == 6 %}
|
|
|
type broadcast;
|
|
|
{%- else %}
|
|
|
type pointopoint;
|
|
@@ -133,11 +136,14 @@ protocol ospf IGP {
|
|
|
area {{ area }} {
|
|
|
{%- for iface in area_ifaces|sort %}
|
|
|
{%- set iface_config = area_ifaces[iface] %}
|
|
|
+ {%- if iface_config.get('AF', AF) != AF %}
|
|
|
+ {%- continue %}
|
|
|
+ {%- endif %}
|
|
|
interface "{{ iface }}" {
|
|
|
{%- if 'desc' in iface_config %}
|
|
|
# {{ iface_config.get ('desc') }}
|
|
|
{%- endif %}
|
|
|
- {%- for attr in iface_config|sort if attr not in ['desc'] %}
|
|
|
+ {%- for attr in iface_config|sort if attr not in ['desc', 'AF'] %}
|
|
|
{%- set value = iface_config.get (attr) %}
|
|
|
{#- 'is bool' only introduced in Jinja 2.11 #}
|
|
|
{%- if salt['ffho.is_bool'](value) %}
|