-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching parameters doesn't seem to work #1246
Comments
cc @ares @ezr-ondrej can one of you guys please look into this? |
Ping, @ares, @ezr-ondrej this has been open for some while now. Do we know anything about this. Can it be closed? |
Caching is a problem, at least with my combination of Ansible (2.9.27) and Below are the calls made to Foreman/Satellite by
|
I just started using Foreman, and subsequently this plugin with Ansible, and just noticed the same issue where the cache settings don't work. The inventory cache file is basically just caching the API url and version/statuses as mentioned above. Any thoughts on getting this working? I'm not terribly well versed with the plugin architecture, but can try and take a crack at it if there are suggestions or guidelines somewhere. |
I happened to notice yesterday when using the |
Okay, so I investigated this a bit, and it's only not using the cache when you're using the Reports API (which is the default these days). Setting I'll see that the new API also gets caching implemented. |
When implementing the Reports API, caching was not properly implemented and wasn't working for users. Fixes: theforeman#1246
When implementing the Report API, caching was not properly implemented and wasn't working for users. Fixes: theforeman#1246
I've posted a patch in #1382 and would appreciate if y'all could test it. |
@evgeni, I tested the new version of the plugin, and the plugin populates the cache correctly now. My Satellite system has 87 hosts for reference.
Below is an example of a cached host entry:
I still see the result from /api/v2/status in the cache. I'm not sure if this is expected.
|
It is expected, as we cache http requests and their replies. |
I can confirm this does cache the inventory now as expected as well 🎉 |
Awesome, thank y'all for reporting, debugging and testing! |
When implementing the Report API, caching was not properly implemented and wasn't working for users. Fixes: #1246
@evgeni One more follow-up now that I'm trying to use this more in depth, but while I am getting inventory caching, it's missing some of the additional host attributes like foreman_facts when reading from the cache that were being used when the inventory was causing some composed keys and keyed_groups to fail to load Sample cached host object
|
Are you sure it's the cache? The code that is now in the "not in cache" branch shouldn't be doing anything about these. |
I can try and debug more, but when I deleted the cache file and reran the inventory I do get the composed variables and keyed groups initially, but once the cache is generated they're gone on subsequent runs or inventory lists |
Interesting. I'll see that I reproduce that tomorrow. Thanks! |
Okay, reproduced with |
@jplindquist please have a try: #1383 |
That looks like it worked! Thank you so much! |
SUMMARY
Caching parameters doesn't seem to work
ISSUE TYPE
ANSIBLE VERSION
COLLECTION VERSION
KATELLO/FOREMAN VERSION
STEPS TO REPRODUCE
Running playbooks with foreman inventory und the following settings:
EXPECTED RESULTS
Active caching for subsequent playbook runs
ACTUAL RESULTS
Playbook runs wait several seconds until facts are fetched from foreman
The text was updated successfully, but these errors were encountered: