diff --git a/map.jinja b/map.jinja --- a/map.jinja +++ b/map.jinja @@ -5,6 +5,7 @@ 'include': '/usr/include', 'lib': '/usr/lib', 'man': '/usr/share/man', + 'sbin': '/usr/sbin', }, 'FreeBSD' : { 'etc': '/usr/local/etc', @@ -12,6 +13,7 @@ 'include': '/usr/local/include', 'lib': '/usr/local/lib', 'man': '/usr/local/man', + 'sbin': '/usr/local/sbin', }, }, default='Debian') %} diff --git a/roles/core/network/files/ysul_ipv6.sh.jinja b/roles/core/network/files/ysul_ipv6.sh.jinja new file mode 100644 --- /dev/null +++ b/roles/core/network/files/ysul_ipv6.sh.jinja @@ -0,0 +1,49 @@ +#!/bin/sh + +# ------------------------------------------------------------- +# IPv6 connectivity +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Project: Nasqueron +# Created: 2017-10-20 +# License: Trivial work, not eligible to copyright +# Source file: roles/core/network/files/ysul_ipv6.sh.jinja +# ------------------------------------------------------------- +# +# <auto-generated> +# This file is managed by our rOPS SaltStack repository. +# +# Changes to this file may cause incorrect behavior +# and will be lost if the state is redeployed. +# </auto-generated> + +IFCONFIG=/sbin/ifconfig +ROUTE=/sbin/route + +# ------------------------------------------------------------- +# Hurricane Electric tunnel +# nasqueron-3.tunnel.tserv10.par1.ipv6.he.net +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +$IFCONFIG gif0 create +$IFCONFIG gif0 tunnel 212.83.187.132 216.66.84.42 +$IFCONFIG gif0 inet6 2001:470:1f12:9e1::2 2001:470:1f12:9e1::1 prefixlen 128 +$ROUTE -n add -inet6 default 2001:470:1f12:9e1::1 +$IFCONFIG gif0 up + +# ------------------------------------------------------------- +# Canonical IP +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +$IFCONFIG gif0 inet6 add 2001:470:1f13:9e1:0:c0ff:ee:1/64 + +# ------------------------------------------------------------- +# Additional IP addresses +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +{% for n in range (2, 16) %} +$IFCONFIG gif0 inet6 add 2001:470:1f13:9e1:0:c0ff:ee:{{ '%x' | format(n) }}/64 alias +{% endfor %} + +{% for n in range (1, 26) %} +$IFCONFIG gif0 inet6 add 2001:470:1f13:9e1::{{ '%x' | format(n) }}/64 alias +{% endfor %} diff --git a/roles/core/network/init.sls b/roles/core/network/init.sls --- a/roles/core/network/init.sls +++ b/roles/core/network/init.sls @@ -6,14 +6,16 @@ # License: Trivial work, not eligible to copyright # ------------------------------------------------------------- +{% from "map.jinja" import dirs with context %} + # ------------------------------------------------------------- # IPv6 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{% if grains['os_family'] == 'Debian' %} +{% if salt['pillar.get']("nodes:" + grains['id'] + ":network:ipv6_tunnel", False) %} network_ipv6: file.managed: - - name : /usr/sbin/ipv6-setup-tunnel + - name : {{ dirs.sbin }}/ipv6-setup-tunnel - source: salt://roles/core/network/files/{{ grains['id'] }}_ipv6.sh.jinja - template: jinja - mode: 755