From fa177355b446a3daa7d55a83f9b5b68c380f72e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo@lysator.liu.se>
Date: Tue, 19 Oct 2021 17:57:06 +0200
Subject: [PATCH] Revert "Remove extra ipv6 conf for Debian."

Hard-coding the ipv6 files for Debian kind of defeats the point of the
network library. However, our network library example42 doesn't provide
any documentation, and no clear examples on how to configure ipv6 for
Debian.

The other alternative, puppet/network, neither provides documentation,
and doesn't even provide any ipv6 examples.

This reverts commit ab786864df469c3c30a0402c527e7c43c5baf26c.
---
 manifests/public_ip.pp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/manifests/public_ip.pp b/manifests/public_ip.pp
index 110fbd9..8ed83dd 100644
--- a/manifests/public_ip.pp
+++ b/manifests/public_ip.pp
@@ -43,6 +43,23 @@ class lysnetwork::public_ip (
     }
     'Debian': {
       package { 'resolvconf': ensure => installed }
+      # An ifdown before and an ifup after would be preferable
+      # but if something goes wrong then than's bad
+      # Also, the interface should only be reinstansiated if the
+      # interface is about to change.
+      file_line { 'source interfaces.d':
+        ensure => present,
+        path   => '/etc/network/interfaces',
+        line   => 'source /etc/network/interfaces.d/*'
+      }
+      file { "/etc/network/interfaces.d/${iface}":
+        content => @("EOF"/$)
+        iface ${iface} inet6 static
+          address 2001:6b0:17:f0a0::${last_octet_16}/64
+          gateway 2001:6b0:17:f0a0::1
+        |- EOF
+        ,
+      }
     }
     default: {}
   }
-- 
GitLab