bird: add radv

This commit is contained in:
Astro 2017-01-20 02:27:04 +01:00
parent 2e4d0e6fb0
commit ff3abbc5d3
2 changed files with 28 additions and 1 deletions

View File

@ -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

View File

@ -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 {