diff --git a/salt-pillar/top.sls b/salt-pillar/top.sls index ac9f787..cca3d38 100644 --- a/salt-pillar/top.sls +++ b/salt-pillar/top.sls @@ -3,15 +3,17 @@ base: - hosts - subnets - vlans - - bird.ospf 'priv*-gw': - dhcp + - bird.radv - bird.ospf 'pub-gw': - dhcp + - bird.radv - bird.ospf 'serv-gw': - dhcp + - bird.radv - bird.ospf 'c3d2-gw or c3d2-anon': - bird.ospf diff --git a/salt/bird/bird6.conf b/salt/bird/bird6.conf index 333813c..59088b4 100644 --- a/salt/bird/bird6.conf +++ b/salt/bird/bird6.conf @@ -10,6 +10,31 @@ protocol device { scan time 10; } +{%- set radv_ifaces = pillar.get('radv') and pillar['radv'].get(salt['grains.get']('id')) %} +{%- if radv_ifaces %} +protocol radv { +{%- for iface, conf in radv_ifaces.items() %} + interface "{{ iface }}" { +{%- if conf.get('rdnss') %} +{%- for value in conf['rdnss'] %} +{%- set host = value.split('.')[0] %} +{%- set net = value.split('.')[1] %} + rdnss {{ pillar['hosts-inet6'][net][host] }}; +{%- endfor %} +{%- endif %} +{%- if conf.get('dnssl') %} + dnssl { +{%- for value in conf['dnssl'] %} + domain "{{ value }}"; +{%- endfor %} + }; +{%- endif %} + }; +{%- endfor %} + +} +{%- endif %} + protocol ospf ZW6 { area 0 { networks {