As I understand from Facrer 2 manual (http://docs.puppetlabs.com/facter/2.1/custom_facts.html#adding-custom-facts-to-facter) I can set all custom facts to /etc/facts/facts.d. Fact example:
Facter.add("role") do setcode do Facter::Util::Resolution.exec('ec2-describe-tags -O KEY -W KEY --filter "resource-id=$(ec2-metadata -i | cut -d " " -f2)" --filter "key=Role" | cut -f5 -') end end It's not far from examples that are in manual. When I try to set this fact to /etc/facts/facts.d - I get error: Fact file /etc/facter/facts.d/role.rb was parsed but returned an empty data set Even if I try to use simple example from manual ( hardware_platform.rb) - I get same error. On Tuesday, July 15, 2014 5:10:59 PM UTC+3, Maxim Nikolaev wrote: > > Hello > > I have strange experience with facter on newly installed servers. > > Puppet: 3.6.2 > Facter: 2.1.0 > OS: Amazon Linux > > when I set custom fact to /etc/facter/facts.d and run facter locally I get > following error > Fact file /etc/facter/facts.d/services.rb was parsed but returned an empty > data set > > > When I copy same file to > /usr/lib/ruby/site_ruby/1.8/facter/ > and run same command - facter works ok. > > > Can someone advise why thi can happen? > -- 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/9e76db90-9ea3-4edf-811c-e29442e871b8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.