facts cache empty after inventory update

361 views
Skip to first unread message

stefan....@gmail.com

unread,
Jul 4, 2022, 6:34:24 AM7/4/22
to AWX Project
Hi,

Most of my playbooks have "enable facts cache" but it looks like the facts get deleted after an inventory update.
Is there a way to keep the old fact cache?

Background:

I've got an inventory with multiple sources and I update them in a work flow.  After updating all vcenter inventories I add variables from a project.
When running this it deletes all the facts from the host like it has deleted the host and remade it.

Kind regards


AWX Project

unread,
Jul 6, 2022, 4:03:20 PM7/6/22
to AWX Project
Hi,

Do you mean the facts are replaced with newer facts for those hosts, or that they are deleted permanently (until you re-run a job that has fact cache enabled)? Also which version of AWX are you using?

AWX Team

Rob B

unread,
Jul 7, 2022, 5:12:37 AM7/7/22
to AWX Project
Hi,

I have this same issue.

In earlier versions (eg. 17.1.0) unticking 'Overwrite' in the inventory source would keep the facts when an inventory sync is run.
But in version 21.1.0, facts are always overwritten when the inventory source is sync'd.

Thanks

Rob B

unread,
Jul 7, 2022, 6:09:04 AM7/7/22
to AWX Project
My mistake - it doesn't seem to be an inventory source sync removing the facts...they're just not there after a certain amount of time.
We use smart inventories populated using custom facts - these inventories are empty in the morning, but repopulate as soon as I run a job to gather facts again.

Rob B

unread,
Jul 12, 2022, 2:51:36 PM7/12/22
to AWX Project
Let me know if you need any more info for this issue...

AWX Project

unread,
Jul 13, 2022, 4:27:32 PM7/13/22
to AWX Project
a similar issue is being reported here https://github.com/ansible/awx/issues/6140

feel free to also including helpful information on the issue to get better traction

AWX Team

Rob B

unread,
Aug 8, 2022, 3:23:01 AM8/8/22
to AWX Project
Sorry for the slow reply - thanks will check it out.

Rob B

unread,
Sep 6, 2022, 9:17:42 AM9/6/22
to AWX Project
I added the following comment to the GitHub issue a couple of weeks ago but no response as yet.

We use custom Ansible facts to populate smart inventories in AWX. This works fine up to AWX 17.1.0, but facts seem to disappear (the smart inventories keep emptying) in any version since using K8s. Currently I have version 21.4.0.

I can run a job to collect facts, and the smart inventories look good. After what seems like a random time (sometimes minutes, other times can be an hour or more) the smart inventories are empty again.
I have tested running inventory syncs with different update options (overwrite, overwrite variables)...neither seem to wipe the facts. Are there any other settings or logs I can check? We rely heavily on the smart inventories.


If there is any info I can provide to help with this please let me know - we're currently having to rely on an old AWX system (17.1.0) to make use of smart inventories.

Thanks
Rob

stefan....@gmail.com

unread,
Sep 6, 2022, 10:09:14 AM9/6/22
to AWX Project
I no longer got this problem after an upgrade :-)

Rob B

unread,
Sep 6, 2022, 12:28:14 PM9/6/22
to AWX Project
No such luck for me so far :(
Reply all
Reply to author
Forward
0 new messages