facter variables not available.

I ran

ansible -u root --private-key=…/.ssh/htnadmin_dsa -i ./invbyname -m setup foo.bar.com

and got a whole bunch of variables to work with, but none of the facter facts from the client.

Facter is installed on the client. I can run facter over there and get all the facts.

What must I do to have ansible get “the facts, ma’am.”

This is ansilble 1.2.

Thanks,

Ed

iirc you also need the json interface to facter installed for ansible to be able to use it. it also looks for it in certain locations so non standard installs tend to ‘fool’ it.

Do you mean, on the client (managed device) or the ansible machine?

Also, is this a python module or an operating system package? (both .deb and .rpm systems are involved.)

Thanks,

Ed G

The json requirement is explained a little bit in It could be installed via a binary package or installed via pip. If trying to install with ansible, you’ll have to use the raw module. It’s unclear to me if that is the root cause of your missing facts though.

@James, diff json dep.

@Ed, actually ruby and facter must support json for ansible to be able to use facter, so which ever way you installed facter you should check that both it and ruby have json support.

You need to be able to run facter --json from the host. If that doesn’t return json, then it won’t work through Ansible I believe.

  • Gonzalo

What Gonzalo said.

Facter doesn’t properly package all of it’s dependencies.

It may be easier to just rely on Ansible provided facts, there are about as many if not more, and then you don’t even need a Ruby dependency.

I should also point out the latest series of Ansible is 1.3.X.