Skip to content
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

clear plugin cache #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

crpb
Copy link
Contributor

@crpb crpb commented Sep 14, 2024

Delete all cached check results on install to clear any lingering notices which might take a couple hourse for the next run. New problems will also come up within our configured check-time and won't hide in the cache for its TTL. 🙈

@zerwes
Copy link
Contributor

zerwes commented Sep 15, 2024

@crpb thank you for the PR
sounds like a good idea to clean the cache in some cases ...
I'll have a look at it in a review ...

@zerwes zerwes self-requested a review September 15, 2024 04:05
@zerwes zerwes self-assigned this Sep 15, 2024
@zerwes zerwes added the enhancement New feature or request label Sep 15, 2024
tasks/main.yml Outdated Show resolved Hide resolved
ansible.builtin.file:
path: /var/lib/check_km_agent/cache/
state: absent
when: opn_install_check_mk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of idempotency, the task should only run if we had some changes ...
So the best way to do this to run it as a handler and let the following tasks trigger/notify it:

  • copy {{ checkmk_agent_name }} from *
  • copy check_mk plugins
  • copy check_mk local checks
  • copy check_mk additional files
  • ... maybe I have overlooked some, so please check it again ...

you can even add a force clean cache task (debug task that notifies the handler?) triggered by a var/setting that defaults to false in order to give the user the opportunity to run this in bulk via ansible ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crpb ... have you consider the triggered solution for the sake of idempotency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above staited, i somehow missed this here and had enough other things to do :P.
just now i've gone through the docs to get a basic idea. won't happen today but hopefully in the next couple weeks :>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants