You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
network_config parses all the ifcft-* files before applying any change to any of them. In case one any of these file have no DEVICE property the parsing will fail and puppet run will consequently fail. I've seen some of these cases in CentOS 7 machines.
On my side I applied the following patch but I can say it's not very elegant.
--- a/code/lib/puppet/provider/network_config/redhat.rb
+++ b/code/lib/puppet/provider/network_config/redhat.rb
@@ -121,6 +121,12 @@ Puppet::Type.type(:network_config).provide(:redhat) do
#
props.merge!({:family => :inet})
+ # If there is no DEVICE property in the interface configuration we retrieve
+ # the interface name from the file name itself
+ unless props.has_key?(:name)
+ props.merge!({:name => filename.split("ifcfg-")[1]})
+ end
+
# The FileMapper mixin expects an array of providers, so we return the
# single interface wrapped in an array
[props]
The text was updated successfully, but these errors were encountered:
I've also found that setting a pre-existing device as absent with "ensure => absent" causes the ifcfg-name file to be set to empty, and causes puppet to throw an error:
Error: Could not prefetch network_config provider 'redhat': No resource and no name in property hash in redhat instance
Notice: /Stage[main]/Site::Network::Interfaces/Network_config[eth1]/ensure: created
Error: /Stage[main]/Site::Network::Interfaces/Network_config[eth1]: Could not evaluate: No resource and no name in property hash in redhat instance
(eth0 is set as absent, eth1 is the next in the list of interfaces to configure)
If this file is removed entirely rather than left empty this does not occur.
Applying the same patch as above works around this for me too.
network_config parses all the ifcft-* files before applying any change to any of them. In case one any of these file have no DEVICE property the parsing will fail and puppet run will consequently fail. I've seen some of these cases in CentOS 7 machines.
On my side I applied the following patch but I can say it's not very elegant.
The text was updated successfully, but these errors were encountered: