OK, I think this is probably something that is entirely my fault, but I 
cannot access a facter fact that I need. It evaluates only on certain 
clients, and is dependent upon the creation and value of another fact. 
Client and server are puppet 2.6.6 and facter 1.5.9.

Custom fact defined in common module:
/etc/puppetdev/modules/common/lib/facter/openldap.rb
Facter.add("is_ldap_server") do
  setcode do
    if  FileTest.exists?("/usr/sbin/slapd")
      Facter.add("ldap_rid") do
        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
      %x{echo yes}.chomp
    else
      %x{echo no}.chomp
    end
  end
end

This fact does evaluate on the client in question:
ldap_rid => 529

However, whatever way I use to try to find it in my template fails...can 
someone please help?
Attempted syntaxes:
<%= @ldap_rid %>
<% @ldap_rid %>
<%= ldap_rid %>
<% ldap_rid %>
<%= scope.lookupvar("ldap_rid") %>
<%= scope.lookupvar("::ldap_rid") %>
...probably others as well. I'm probably just scoping it wrong, but every 
time it comes up as blank or 'undef'.

Thanks.

-- 
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/-/INd3uN7go6sJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to