Project

General

Profile

Actions

Bug #36036

open

Please add $interface[subnet][prefix]

Added by Han Boetes almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

I just set up a puppet class for systemd-networkd, see below
The problem is, the $interface array doesn't contain prefix. It does have networkmask (/255.255.255.0), but systemd-networkd wants prefix (/24).

  $::foreman_interfaces.each |$interface| {
    if ($interface[primary] == true) {
      $content = @("EOT")
[Match]
Name=${interface[identifier]}
[Network]
Address=${interface[ip]}/${interface[subnet][prefix]}
Gateway=${interface[subnet][gateway]}
DNS=${interface[subnet][dns_primary]}
DNS=${interface[subnet][dns_secondary]}

# ${interface}                                                                                                                 
|EOT
      systemd::network{"${interface[identifier]}.network":
        content         => $content,
        restart_service => false,
      }
    }
  }

Which results in:

[Match]
Name=eno2
[Network]
Address=10.10.11.224/
Gateway=10.10.10.1
DNS=10.10.10.11
DNS=10.10.10.12

Therefore my kind request to add ${interface[subnet][prefix]} to the exported variables.

Actions

Also available in: Atom PDF