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.
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?
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.
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.
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.