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