Page MenuHomeDevCentral

Salt configuration for IPv6 for Debian
ClosedPublic

Authored by Sandlayth on May 10 2016, 07:19.
Tags
Referenced Files
Unknown Object (File)
Tue, Dec 17, 02:57
Unknown Object (File)
Mon, Dec 16, 09:34
Unknown Object (File)
Sun, Dec 15, 04:50
Unknown Object (File)
Sun, Dec 15, 04:49
Unknown Object (File)
Fri, Dec 13, 05:10
Unknown Object (File)
Thu, Dec 12, 21:41
Unknown Object (File)
Thu, Dec 12, 13:19
Unknown Object (File)
Sun, Dec 8, 01:04

Details

Summary

On Debian, network could be managed putting files
in /etc/network/interfaces.d.

Ubuntu follows also this system.

Resolves T768.

Test Plan

Run on the master:

salt eglide state.sls roles/core/network/init

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
No Lint Coverage
Unit
No Test Coverage
Branch
arcpatch-D370_1
Build Status
Buildable 556
Build 671: arc lint + arc unit

Event Timeline

Sandlayth retitled this revision from to Salt configuration for IPv6 tunnel on the eglide server..
Sandlayth updated this object.
Sandlayth edited the test plan for this revision. (Show Details)
Sandlayth added a reviewer: dereckson.
Sandlayth added subscribers: Sandlayth, dereckson.

Parameters look good.

Did you test it? What's the output generated?

dereckson requested changes to this revision.Jun 5 2016, 23:37
dereckson edited edge metadata.
dereckson added inline comments.
roles/shellserver/network/init.sls
1 ↗(On Diff #886)

Header is missing.

14 ↗(On Diff #886)

When tested, it would be cool to add extra IPs too.

This revision now requires changes to proceed.Jun 5 2016, 23:37
Sandlayth edited edge metadata.
  • Reformatting file to a good yaml syntax.
roles/shellserver/network/init.sls
13 ↗(On Diff #953)

extra whitespaces

dereckson retitled this revision from Salt configuration for IPv6 tunnel on the eglide server. to Salt configuration for IPv6 tunnel on the eglide server.Jun 6 2016, 01:28
dereckson edited edge metadata.

upstream Configuration is blocked by https://github.com/saltstack/salt/issues/28114

We so have two choices:

  1. once https://github.com/saltstack/salt/pull/33622 is merged, we could customize a Salt setup — http://ryandlane.com/blog/2015/06/03/using-development-branch-saltstack-python-modules-in-the-stable-release/
  2. we could keep this block for every OS, but for Debian replace it by the deployment of a file to /etc/network/interfaces.d directory
dereckson requested changes to this revision.Jun 8 2016, 19:33
dereckson edited edge metadata.
This revision now requires changes to proceed.Jun 8 2016, 19:33
Sandlayth edited edge metadata.
  • IPv6 support in interfaces
    • eglide network config written in a file
dereckson requested changes to this revision.Jun 15 2016, 01:10
dereckson edited edge metadata.
dereckson added inline comments.
roles/shellserver/network/init.sls
11 ↗(On Diff #972)

Valid for Ubuntu too.

This revision now requires changes to proceed.Jun 15 2016, 01:10
Sandlayth edited edge metadata.
  • Deleting redundant lines
Sandlayth edited edge metadata.
  • Don't skip the 2 first ipv6 adresses
  • created a core role for anything appliable to all servers
  • whitespace issue
  • file will be /etc/network/interfaces.d/eglide_ipv6
dereckson retitled this revision from Salt configuration for IPv6 tunnel on the eglide server to Salt configuration for IPv6 for Debian.Jun 15 2016, 02:04
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a project: IPv6.
dereckson requested changes to this revision.Jun 15 2016, 02:09
dereckson edited edge metadata.
$ salt eglide state.highstate
eglide:
----------
          ID: network_ipv6
    Function: file.managed
        Name: /etc/network/interfaces.d/ipv6
      Result: False
     Comment: Parent directory not present
     Started: 02:06:29.738768
    Duration: 523.4 ms
     Changes:   
----------

We should add makedirs : True per https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.managed

This revision now requires changes to proceed.Jun 15 2016, 02:09
dereckson edited edge metadata.
  • Rebase against master
  • makedirs: True
dereckson requested changes to this revision.Jun 15 2016, 02:20
dereckson edited edge metadata.
dereckson added inline comments.
roles/core/network/files/eglide_ipv6
7

local 10.1.21.90

roles/core/network/init.sls
19

template is Jinja

This revision now requires changes to proceed.Jun 15 2016, 02:20
dereckson edited edge metadata.

Fixed template issues

Don't forget 2001:470:1f13:896::c0de:15:11fe too.

dereckson edited edge metadata.
  • extra IP are 'static', not a tunnel
  • + canonical IPv6

Switch to pure legacy mode using commands and ifconfig.

Tunnel doesn't work using this block:

$ ip tunnel add he-ipv6 mode sit remote 216.66.84.42 local 212.47.244.42 ttl 255
$ ip link set he-ipv6 up
$ ip addr add 2001:470:1f12:896::2/64 dev he-ipv6
$ ip route add ::/0 dev he-ipv6
$ ip -f inet6 addr

But it works when we use ifconfig. So, instead to let Debian configure
it through Linux-route2 ip command, we create a script to configure it
ourselves.

Then, rc.local is edited to run this script.

Test run results:

eglide:
----------
          ID: rc
    Function: file.managed
        Name: /etc/rc.local
      Result: True
     Comment: File /etc/rc.local updated
     Started: 12:26:51.352035
    Duration: 757.121 ms
     Changes:   
              ----------
              diff:
                  --- 
                  +++ 
                  @@ -1,14 +1,24 @@
                   #!/bin/sh -e
                  +
                  +#   -------------------------------------------------------------
                  +#   rc.local
                  +#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  +#   Project:        Nasqueron
                  +#   Created:        2016-06-15
                  +#   License:        Trivial work, not eligible to copyright
                  +#   -------------------------------------------------------------
                  +
                  +#   -------------------------------------------------------------
                  +#   IPv6
                  +#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  +
                  +/usr/sbin/ipv6-setup-tunnel
                  +
                  +#   -------------------------------------------------------------
                  +#   Return value
                   #
                  -# rc.local
                  -#
                  -# This script is executed at the end of each multiuser runlevel.
                  -# Make sure that the script will "exit 0" on success or any other
                  -# value on error.
                  -#
                  -# In order to enable or disable this script just change the execution
                  -# bits.
                  -#
                  -# By default this script does nothing.
                  +#   Should be 0 on success, not 0 on failure. Current rc process
                  +#   requires this value to be set accordingly.
                  +#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                   
                   exit 0
----------
          ID: network_ipv6
    Function: file.managed
        Name: /usr/sbin/ipv6-setup-tunnel
      Result: True
     Comment: File /usr/sbin/ipv6-setup-tunnel updated
     Started: 12:26:52.110362
    Duration: 738.835 ms
     Changes:   
              ----------
              diff:
                  New file
              mode:
                  0644
----------
roles/core/network/files/eglide_ipv6
12

Do we have paths available in rc.local?

Would make sense to use /sbin/ifconfig and /sbin/rouge

Use /sbin/ifconfig and /sbin/route

dereckson edited edge metadata.
This revision is now accepted and ready to land.Jun 15 2016, 13:50
This revision was automatically updated to reflect the committed changes.