Hi,

this is a misunderstanding. What you implemented is a native custom
fact. You cannot deploy it along with your external facts.

Instead of putting is in some_module/facts.d/, move it to
some_module/lib/facter/ instead. It will be synced as a custom fact and
should then work.

With external facts, you would need to make your Ruby script print

datacenter=HOUSTON

or

datacenter=AUSTIN

on stdout.

HTH,
Felix

On 10/23/2014 09:01 PM, Difladermaus wrote:
>
> facter --debug returns
>
> Fact file /etc/puppetlabs/facter/facts.d/datacenter.rb was parsed but
> returned an empty data set
>
>
> Any help appreciate
>
>
> # cat /etc/puppetlabs/facter/facts.d/datacenter.rb
>
>
> Facter.add("datacenter") do
>
>   setcode do
>
>     datacenter = "unknown"
>
>     # Get current ip address from Facter's own database
>
>     ipaddr = Facter.value(:ipaddress)
>
>     ######################################## HOUSTON data center
>
>     if ipaddr.match("^10.220.")
>
>         datacenter = "HOUSTON"
>
>     ######################################## AUSTIN data center
>
>     elsif ipaddr.match("^10.221.")
>
>         datacenter = "AUSTIN"
>
>     end
>
>     datacenter
>
>   end
>
> end
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/545E898C.5070606%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to