I have it working, but I'm curious if this might be a bug with nested 
Facter.add statements?

I simply un-nested them and used a 'confine' statement to make things work. 
New facts posted below:
Facter.add("is_ldap_server") do
  setcode do
    if  FileTest.exists?("/usr/sbin/slapd")
      %x{echo yes}.chomp
    else
      %x{echo no}.chomp
    end
  end
end

Facter.add("ldap_rid") do
  confine :is_ldap_server => :yes
  setcode do
    case Facter::network_eth0
    when "192.168.96.0"
      Facter::ipaddress[/[0-9]+$/].chomp
    when "192.168.97.0"
      ( 500 + Facter::ipaddress_eth0[/[0-9]+$/].chomp.to_i )
    end
  end
end

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/ob5dE8e2afMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to