Ask Your Question

external facts reference

asked 2016-09-22 10:04:12 -0500

puser gravatar image


Excuse my naivety but I am having a large amount of trouble with external facts. I have seen that you need to create a folder called


to store external facts in. Inside my facts.d folder I have


Now inside my I have the following:

OUTPUT="$(/bin/rpm -qa --queryformat \'%{FILENAMES}\' pkg_jvmtop)"

I know you need to return things in a key/value pair like


Thus I am echoing


I am getting several errors when attempting

puppet apply /fact.d/

Can someone explain (in great detail) what I am doing wrong and how to reference JVMTOP_HOME in my manifests? I assume it is stupid, below are the errors I am getting:

Error: This Name has no effect. A value was produced and then forgotten (one or more preceding expressions may have the wrong form) at        /etc/puppetlabs/code/environments/production/modules/jvmtop/facts.d/
Error: Illegal attempt to assign to 'a Type-Name'. Not an assignable reference at /etc/puppetlabs/code/environments/production/modules/jvmtop/facts.d/
Error: Found 2 errors. Giving up
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-09-22 13:43:28 -0500

lupin gravatar image

You can't execute an executable facts like what you did(puppet apply). Make sure your is executable and that indeed result a key=value pair. Then on a puppet node(with module that contains the fact) and pkg_jvmtop package is installed, you can query it with facter -p key - where key is the the key on your key=value pair.

edit flag offensive delete link more


I gotcha, I can now reference the key in my manifests however when I try the facter -p key it doesn't come up. Any idea what?

puser gravatar imagepuser ( 2016-09-22 14:05:42 -0500 )edit

I've had issues where I need to do 'sudo facter -p' to see my custom facts. The other alternative is to manually place the FACTER_LIB=/path/to/facts facter -p key (I can't remember the exact path right now). I also use that to reference my facts in irb for doing some debugging...

DarylW gravatar imageDarylW ( 2016-09-22 23:33:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-09-22 10:04:12 -0500

Seen: 87 times

Last updated: Sep 22 '16