Problem:
custom facts from Ansible do not show up in the Foreman database. The do show up in my cached fact files - in other words, I see fact files show up in ~/workspace/fact_cache after Ansible runs. But they don’t show up in Foreman UI or the database currently. I believe I was able to do this before.
Expected outcome:
when I run “hammer host facts | grep ansible_local” I should see the custom facts from several hosts show up.
when I go to the fact values web, I should be able to successfully search “type = ansible_local”
Foreman and Proxy versions:
Foreman 2.5.1
Foreman and Proxy plugin versions:
Distribution and version:
Ubuntu 20.04.2
Other relevant data:
From my cached fact files - I can observe the custom facts are there:
For my testbed I’ll look into Facter for custom facts. I like how it includes ec2 metadata out of the box. The tradeoff is the installation of Ruby and it’s dependencies, but if I really care about it, probably a dockerized Facter will work.
The odd part is I know I had ansible_local showing up in the Foreman UI. I was so happy to see for that one moment that I will cherish.
Just so that I fully understand, are you able to see other Ansible facts? Or other facts, meaning Puppet, subscription-manager facts etc? The Ansible callback that sends facts does not differentiate between custom and non-custom facts AFAICT. Since you talk about some terraform setup, does it run foreman-installer as part of the configuration? If not, how did you configure ansible.cfg for the foreman_proxy that runs Ansible?
Just so that I fully understand, are you able to see other Ansible facts? Or other facts, meaning Puppet, subscription-manager facts etc? The Ansible callback that sends facts does not differentiate between custom and non-custom facts AFAICT.
Yes all other facts I can see in the Foreman UI and database. For my playbook I’m just doing gather_facts: yes and when I have the cache turned on, I can see the custom facts (ansible_local) in my filesystem. But for some reason they don’t end up in Foreman.
Since you talk about some terraform setup, does it run foreman-installer as part of the configuration? If not, how did you configure ansible.cfg for the foreman_proxy that runs Ansible?
My Terraform is only for the AWS resources, the rest are bash snippets I copy/paste in. For the callback configuration I’m using environment variables: