Skip to content

Set an explicit one-hour fact cache timeout - #97

Merged
sameeralam3127 merged 2 commits into
sameeralam3127:mainfrom
ra5alghu1:fix/fact-cache-timeout
Sep 26, 2026
Merged

sameeralam3127 merged 2 commits into
sameeralam3127:mainfrom
ra5alghu1:fix/fact-cache-timeout

Conversation

@ra5alghu1

Copy link
Copy Markdown
Contributor

The checkout uses a persistent fact cache without an explicit timeout, so Ansible defaults to 24 hours. This sets it to one hour, as suggested in #25.

I kept caching enabled and added instructions for a fresh scan with --flush-cache. I also updated the existing cache notes so the docs agree. Discovery still refreshes its health-related facts on every scan. The setting applies to the source checkout; Galaxy users keep their own configuration.

All 212 tests pass, along with pre-commit, ansible-lint, and the playbook syntax check. No managed-host scan or Docker scenario was run for this configuration and documentation change.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 53d2f3fc-4ff6-4656-85cd-696adea46032


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pr-reviewer-bots

Copy link
Copy Markdown

Thanks for opening this PR. Assigned to @sameeralam3127. Labels added: documentation, size/medium. Checklist: 2/3 passed (see checks tab for details).

@sameeralam3127

Copy link
Copy Markdown
Owner

Thanks, @ra5alghu1 — this hits all three acceptance criteria on #25, and I appreciate that you went back and fixed performance.md and runbook.md instead of leaving them describing the old "no expiry" state. That drift is the part these changes usually miss.

I checked the claims rather than taking them on trust:

  • ansible.cfg is in galaxy.yml's build_ignore, so "not shipped in the Galaxy collection" is accurate.
  • roles/vitals_scan/tasks/discovery.yml does explicitly re-gather min/hardware/network/virtual, and all three playbooks use gather_facts: true with gathering = smart — so the timeout genuinely bounds the implicit gather, which is the hazard the issue described.
  • pytest -q → 212 passed, ansible-lint roles/ playbooks/ molecule/ demo/ passed, syntax check passed.

One thing I'd like before merging. CONTRIBUTING asks for a test with every behaviour change, and four docs now quote the one-hour value, so I'd like it pinned: a small test that asserts ansible.cfg sets fact_caching_timeout = 3600. tests/test_ci_floor.py is the pattern to follow — it exists for the same reason, stopping config that docs depend on from drifting silently. configparser on the repo's ansible.cfg is enough; no new fixture needed.

Two minor notes, neither blocking:

  • ### Cached facts is the only heading in troubleshooting.md and jumps from # to ###. ## reads better and keeps the same #cached-facts anchor the other three docs link to.
  • The intake bot is unhappy only about the title not being Conventional Commits. Ignore it — the repo's own history isn't, and I'll set the final title on merge.

CI needs my approval to run on a first PR; I'll kick that off now.

Resolves the CHANGELOG.md conflict created by sameeralam3127#95 and sameeralam3127#96 landing in the
same [Unreleased] -> Changed block. Keeps all three entries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sameeralam3127

Copy link
Copy Markdown
Owner

Heads-up, @ra5alghu1: I pushed one commit to your branch rather than asking you to rebase. #95 and #96 landed first and all three PRs added an entry to the same [Unreleased] → ### Changed block, so CHANGELOG.md conflicted. The commit is a plain merge of main into your branch keeping all three entries — no force-push, your commits are untouched.

Verified on the merged result before pushing: pytest -q 213 passed, ansible-lint roles/ playbooks/ molecule/ demo/ passed, syntax check passed. The diff against main is still exactly your six files.

I've approved the re-run and this goes in once it's green. On the test I asked for — I'm merging without it and filing a follow-up instead, since the config change itself is sound and I'd rather not hold the fix. Thanks for a careful change; going back to fix performance.md and runbook.md so they stopped describing the old "no expiry" state was the right instinct.

@sameeralam3127
sameeralam3127 merged commit e9f04fa into sameeralam3127:main Sep 26, 2026
8 of 9 checks passed
@ra5alghu1

ra5alghu1 commented Sep 26, 2026 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-conventional-title size/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants