puppet-network icon indicating copy to clipboard operation
puppet-network copied to clipboard

Dual Stack Support

Open pschichtel opened this issue 2 years ago • 3 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.25.0
  • Ruby: 2.7.8p225
  • Distribution: Debian Bullseye
  • Module version: 1.1.0

How to reproduce (e.g Puppet code you use)

network_config { "${interface} - IPv4":
    ensure  => 'present',
    name    => $interface,
    family  => 'inet4',
    method  => 'dhcp',
    hotplug => true,
}
$ipv6_config_name = "${interface} - IPv6"
network_config { $ipv6_config_name:
    ensure    => 'present',
    name      => $interface,
    family    => 'inet6',
    method    => 'static',
    hotplug   => true,
    ipaddress => "${some_ipv6_prefix}::1",
    netmask   => 64,
}
network_route { 'default':
    ensure    => 'present',
    gateway   => "${some_other_ipv6_prefix}::1",
    interface => $interface,
    netmask   => 0,
    network   => 'default',
    require   => Network_config[$ipv6_config_name],
}

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Network_config[eth0 - IPv6] to ["eth0"] at (file: .../manifests/network.pp, line: 41); resource ["Network_config", "eth0"] already declared (file: .../network.pp, line: 12) (file: .../network.pp, line: 41, column: 13) on node ...

What behaviour did you expect instead

I'm migrating from https://github.com/example42/puppet-network, which allows me to configure both IPv4 and IPv6 for the same interface.

::network::interface { "${interface} - IPv4":
    interface     => $interface,
    allow_hotplug => true,
    enable_dhcp   => true,
}
::network::interface { "${interface} - IPv6":
    interface => $interface,
    family    => 'inet6',
    auto      => false,
    ipaddress => "${some_ipv6_prefix}::1",
    netmask   => 64,
    gateway   => "${some_other_ipv6_prefix}:${vlan}::1",
}

That produced /etc/network/interfaces entries like this:

# Interface eth0 - IPv4
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
# Interface eth0 - IPv6
iface eth0 inet6 static
    address ${some_ipv6_prefix}::1
    netmask 64
    gateway ${some_other_ipv6_prefix}::1

Output log

Any additional information you'd like to impart

pschichtel avatar Jul 23 '23 21:07 pschichtel

example42 let me select the name and the interface independently, while this module doesn't, which prevents dual stack configurations like this. Or am I missing something?

pschichtel avatar Jul 23 '23 21:07 pschichtel

I can recommend using our systemd module to configure systemd-networkd instead.

kenyon avatar Jul 23 '23 21:07 kenyon

:/ that's another evening down the drain, but the systemd module definitely seems to be in better shape

pschichtel avatar Jul 23 '23 21:07 pschichtel