Error: Failed to apply catalog: Parameter netmask failed on Network_config[eth0:0]: Puppet::Type::Network_config::Netmask requires a valid netmask for the netmask property at
Setting a correct IPv6 netmask like netmask 64
Not able to apply a IPv4 netmask to a IPv6 ip
Output log
Any additional information you'd like to impart
As a quick, dirty and incorrect fix:
--- a/lib/puppet/type/network_config.rb
+++ b/lib/puppet/type/network_config.rb
@@ -43,7 +43,7 @@ Puppet::Type.newtype(:network_config) do
desc 'The subnet mask to apply to the interface'
if defined? IPAddress
validate do |value|
- raise ArgumentError, "#{self.class} requires a valid netmask for the netmask property" unless IPAddress.valid_ipv4_netmask? value
+ raise ArgumentError, "#{self.class} requires a valid netmask ( #{value} ) for the netmask property" unless ( IPAddress.valid_ipv4_netmask? value or ( value >= 0 && value.to_i <= 128 ) )
# provider.validate
end
end
This quickfix, dirtyfix and incorrectfix, would allow now to set a invalid ipv4 netmask too, but would also allow to set a correct ipv6 netmask.
It would:
still allow to set a ipv4 netmask for ipv6 adresses
allow to set a ipv6 netmask for ipv4 adresses
For clean fix for this, would result in a rewrite of the type, to check:
Affected Puppet, Ruby, OS and module versions/distributions
Tested with both moduleversions
How to reproduce (e.g Puppet code you use)
issues:
how to reproduce issues:
What are you seeing
issue 1: Config:
Result error:
issue 2: Config:
Result /etc/network/interfaces:
What behaviour did you expect instead
Setting a correct IPv6 netmask like netmask 64 Not able to apply a IPv4 netmask to a IPv6 ip
Output log
Any additional information you'd like to impart
As a quick, dirty and incorrect fix:
This quickfix, dirtyfix and incorrectfix, would allow now to set a invalid ipv4 netmask too, but would also allow to set a correct ipv6 netmask. It would:
For clean fix for this, would result in a rewrite of the type, to check: