Puppet: System Administration Automated

Support

Ticket #820 (new defect)

Opened 1 year ago

Last modified 6 months ago

redhat interface provider does not prefetch interfaces without ipaddr

Reported by: puppet Assigned to: luke
Priority: normal Milestone: unplanned
Component: interface Version: 0.23.2
Severity: normal Keywords: interface linux redhat
Cc: Triage Stage: Needs design decision
Attached Patches: None Complexity: Unknown

Description

Having upgraded puppet on a redhat server to 0.23.2 (which includes the interface provider) from 0.22.4 where it was a patch, the interface provider redhat.rb does not function correctly; and seems to have difficulty parsing ifcfg-<interface> files where there are no IP addresses contained - thus failing to create the resource correctly.

With the following interface definition :

interface { "192.168.19.230":
        interface_type => "dummy",
        onboot => true
}

The following appears in the logs under such circumstances :

err: Could not create 192.168.19.230: undefined method `provider' for nil:NilClass
err: undefined method `provider' for nil:NilClass

Change History

09/11/07 12:31:52 changed by puppet

In addition, more often we see :

err: Could not prefetch interface provider 'redhat': No resource and no name in property hash in redhat instance
err: //Interface[192.168.19.230]: Failed to retrieve current state of resource: [] called on a property at /tmp/interface.pp:4

09/11/07 13:01:48 changed by porridge

After some investigation, the following message:

err: Could not prefetch interface provider 'redhat': No resource and no name in property hash in redhat instance

Appears for another reason: we have bonded eth0 and eth1 interfaces, whose /etc/sysconfig/network-scripts/ifcfg-eth0 do not contain IP addresses. The hash resulting from parsing such file (during parse() call in self.instances() in redhat provider) looks like this:

{:interface_type=>:normal, :slave=>"yes", :onboot=>:true, :master=>"bond0", :interface=>"eth0", :userctl=>"no"}

This in turn causes the exception to be thrown in prov.name() called in self.prefetch() (which is where the message comes from).

I'm still trying to find out what causes the second message.

09/11/07 13:16:16 changed by porridge

*sigh*

The other message was caused by my home-grown "fix" to #757 (to make solaris provider work).

So if you keep the "target" a "param" (as it is in the original puppet distribution) instead of a "property" it works for redhat.

09/11/07 13:36:56 changed by porridge

  • keywords changed from interface linux redhat broken to interface linux redhat.
  • summary changed from interface provider on linux does not work to redhat interface provider does not prefetch interfaces without ipaddr.

So it turns out this bug is not as serious as we thought. The only remaining issue is the error when prefetching interfaces:

err: Could not prefetch interface provider 'redhat': No resource and no name in property hash in redhat instance

This is because :name is set only if ipaddr is set. I changed the ticket summary accordingly.

This does not seem to affect puppet's capability to manage the interface, though. It's just that prefetching breaks if such interface is present.

09/11/07 19:10:20 changed by michael

  • owner changed from community to luke.
  • stage changed from Unreviewed to Accepted.

11/20/07 21:25:26 changed by luke

  • milestone set to misspiggy.

11/23/07 23:16:49 changed by luke

  • stage changed from Accepted to Needs design decision.
  • milestone changed from misspiggy to unplanned.

I'm delaying this until we figure out how to fix the design problems here.

04/24/08 07:05:16 changed by luke

  • component changed from library to interface.