Hi,

I've this custom fact,
- it's working fine when running via puppet on Debian 6-7, Centos/Rhel 6
- it's going on timeout when running via puppet on Rhel5. "Warning: Could not load fact file /var/lib/puppet/lib/facter/interfaces_duplex.rb: execution expired"
- it's working fine when I get it via "facter -p" on all my Linux

Is anyone have an idea why ? All my nodes are running puppet 3.6.2 (package from puppetlabs)


cat /var/lib/puppet/lib/facter/interfaces_duplex.rb
if Facter.value(:kernel) == 'Linux' and Facter.value(:virtual) =~ /^(physical|vmware|xen0)/
  Dir.glob('/sys/class/net/{eth,em}?').each do |iface|
    fstate = File.open(File.join(iface,'operstate'))
    state = fstate.read
    if state.strip() == 'up'
      Facter.add("duplex_" + File.basename(iface)) do
        confine :kernel => 'Linux'
        setcode do
          fduplex = File.open(File.join(iface,'duplex'))
          if fduplex
            duplex = fduplex.read
            duplex.strip()
          end
        end
      end
      Facter.add("speed_" + File.basename(iface)) do
        confine :kernel => 'Linux'
        setcode do
          fspeed = File.open(File.join(iface,'speed'))
          if fspeed
            speed = fspeed.read
            speed.strip()
          end
        end
      end
    end
  end
end

Best regards,
Benjamin

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/54B51EF0.707%40quake.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to