Closed jbertozzi closed 4 years ago
It's entirely possible that it's the ruby version. Do you have the facility to test with another ruby version on RHEL6 (IE software collections, IUS)?
Just for documentation, what version of ruby are you seeing this behavior with?
I'm seeing the same issue on RedHat 7.6:
Notice: /Stage[main]/Common::Network/Network::Bond[bond0]/Network::Bond::Redhat[bond0]/Network_config[eno5]/options: op
tions changed {
'MASTER' => 'bond0',
'SLAVE' => 'yes',
'NM_CONTROLLED' => 'false',
'ETHTOOL_OPTS' => 'speed 10000 duplex full autoneg off'
} to ETHTOOL_OPTS => speed 10000 duplex full autoneg off, MASTER => bond0, NM_CONTROLLED => false, SLAVE => yes
Info: Computing checksum on file /etc/sysconfig/network-scripts/ifcfg-eno5
Notice: /Stage[main]/Common::Network/Network::Bond[bond0]/Network::Bond::Redhat[bond0]/Network_config[eno6]/options: op
tions changed {
'MASTER' => 'bond0',
'SLAVE' => 'yes',
'NM_CONTROLLED' => 'false',
'ETHTOOL_OPTS' => 'speed 10000 duplex full autoneg off'
} to ETHTOOL_OPTS => speed 10000 duplex full autoneg off, MASTER => bond0, NM_CONTROLLED => false, SLAVE => yes
Info: Computing checksum on file /etc/sysconfig/network-scripts/ifcfg-eno6
Ruby version:
# /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
This turned out to be an issue with true
/false
/'yes'
/'no'
, as the resource will happily accept boolean values in the slave_options
parameter. I did a quick fix to our own Puppet wrapper:
$bonded_interfaces.each |$_name, $_config| {
$_merged_config = $_config + {
# make sure we have 'yes'/'no' instead of booleans
'slave_options' => $_config.dig('slave_options').lest || { {} }.reduce({}) |$acc, $kv| {
[$k, $v] = $kv
$acc + {
$k => $v ? {
Boolean => to_yesno($v),
default => $v,
}
}
}
}
network::bond { $_name:
* => $_merged_config,
}
}
The function to_yesno
is just what it says.
...not the most pretty, but works fine.
I've got a branch that has this at https://github.com/runejuhl/puppet-network/tree/coerce-boolean-values . I figure a proper PR should implement the same in Ruby instead, that'd be a lot prettier.
Hi,
I am facing a strange behavior under RHEL7 when using this module for bonding configuration.
Here is the resource declaration:
Variable have correct values set and the files generated are as expected:
The problem is that this resource is applied at everyrun:
My interfaces seem to be seen as absent from Puppet point of view on RHEL7:
While it is working on RHEL6:
Any thought why this behavior is different? Could this be linked to the Ruby version?