Browse Source

Salt: enable ipv6 on prod server

merge-requests/69/head
Deimos 6 years ago
parent
commit
d04da96086
  1. 2
      salt/pillar/prod.sls
  2. 13
      salt/salt/prod-config.sls

2
salt/pillar/prod.sls

@ -6,3 +6,5 @@ nginx_worker_processes: auto
postgresql_version: 10 postgresql_version: 10
prometheus_ips: ['127.0.0.1'] prometheus_ips: ['127.0.0.1']
site_hostname: tildes.net site_hostname: tildes.net
ipv6_address: '2607:5300:0203:2dd8::'
ipv6_gateway: '2607:5300:0203:2dff:ff:ff:ff:ff'

13
salt/salt/prod-config.sls

@ -2,3 +2,16 @@
/etc/apt/apt.conf.d/99force-ipv4: /etc/apt/apt.conf.d/99force-ipv4:
file.managed: file.managed:
- contents: 'Acquire::ForceIPv4 "true";' - contents: 'Acquire::ForceIPv4 "true";'
# Enable ipv6 networking
/etc/network/interfaces:
file.append:
- text: |
iface eth0 inet6 static
address {{ pillar['ipv6_address'] }}
netmask 64
post-up sleep 5; /sbin/ip -family inet6 route add {{ pillar['ipv6_gateway'] }} dev eth0
post-up sleep 5; /sbin/ip -family inet6 route add default via {{ pillar['ipv6_gateway'] }}
pre-down /sbin/ip -family inet6 route del default via {{ pillar['ipv6_gateway'] }}
pre-down /sbin/ip -family inet6 route del {{ pillar['ipv6_gateway'] }} dev eth0
Loading…
Cancel
Save