example42/puppet-network

Usage of obsolete syntax in route-RedHat.erb

stdietrich opened this issue · 0 comments

Expected Behavior

Creating a network::route should result into a valid configuration.
Given the following resource:

network::route {'em2':
  ipaddress => ['192.168.1.0',],
  netmask => ['255.255.255.0',],
  gateway => ['192.168.1.1',],
}

Should create /etc/sysconfig/network-scripts/route-em2 with the following content:

192.168.1.0/24 via 192.168.1.1 dev em2

Actual Behavior

/etc/sysconfig/network-scripts/route-em2 will be created with obsolete syntax:

192.168.1.0/255.255.255.0 via 192.168.1.1 dev em2

The old version worked on RHEL until 7.5, where NetworkManager has been upgraded to 1.10.
NetworkManager 1.10 contains a change, where specifying netmask is no longer supported. Only the CIDR notation is supported.

The route.pp already handles this case, but the template is hard-coded to use netmask instead of cidr.
I will prepare a PR in a couple of minutes fixing this.

Edit:
Actual error message from /var/log/messages with old config file format:

NetworkManager[14704]: <warn>  [1537442039.7641] ifcfg-rh:     ignoring invalid route at "192.168.1.0/255.255.255.0  via 192.168.1.1 dev em2" (/etc/sysconfig/network-scripts/route-em2:5): Argument for "192.168.1.0/255.255.255.0" is not ADDR/PREFIX format

Just in case someone else is running in that problem as well.