Upload ansible facts to satellite


I am using satelite 6.3(sorry for asking quest on foreman forum :slight_smile: ) i have created playbook using “uri” module to run POST to upload ansible facts to satellite, it works well if i do not include ‘network’ subset in “setup” module and upload all other facts

How do i filter some values produced by “setup” module, for example “ansible_interfaces” creates issue in upload, it gives error with “downcase” method in puppet facts parser code in ruby.

I know there is foreman.py callback and the reason i am not using it because it uploads facts at the exectuion of each role where i have 50 roles and i only want to upload it onces (with many hosts trying to upload might cause issues with satellite), and i dont have way to run callback with specific role only.

Appriciate some guidance on the same.


There’s no filtering on server side except for interfaces names. There’s also a setting to disable interfaces creation based on facts but I’m not sure if it helps in your case. You didn’t mention what the problem with network facts is. Why not filter it on ansible side?


Yes now i am trying to find a way to filter JSON on ansible side and then upload it to satellite( not sure how to do that in ansible )

Error i get with network subset is

“Json”: {“error”: {“message”: " undefined method ‘downcase’ for [“lo”, “ens192"”]:Array

If i do

  • setup:
    gather_subset: “!all,hardware,ohai,virtual,favter”

It works without “network”

Status code 500.


You would have to write your own callback or modify Ansible’s provided to make that kind of modification.
Also notice some bugfixes about parsing facts such as https://github.com/theforeman/foreman_ansible/commit/50f9bbdce8be19e1794a93ffb917b4eba9995bce have not trickled down to Satellite yet.

Thanks dLobatog,

Currently i am manually passing operatingsystem for upload to work and it works nicely, only issue is some of the JSON output is not compatible with puppet parser script.

For callback, how can i run callback witb specific role only ? As i have many roles and used by many diff application teams and dont want them to overload satellite with lot of uploads.