Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual Stack Support #304

Open
pschichtel opened this issue Jul 23, 2023 · 3 comments
Open

Dual Stack Support #304

pschichtel opened this issue Jul 23, 2023 · 3 comments

Comments

@pschichtel
Copy link

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
Copy link
Author

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?

@kenyon
Copy link
Member

kenyon commented Jul 23, 2023

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

@pschichtel
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants