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

Feature package locking #1243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

lupa95
Copy link

@lupa95 lupa95 commented Mar 13, 2024

This is an attempt at fixing the idempotency issue discussed in #1240.

Packages get version locked and unlocked when installing/updating them, rather than adding and removing the package repositories on each run.

Unfortunately, it requires a module from the community.general collection. I am not sure if you want to introduce this.

Copy link

@jonhattan jonhattan left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Instead of lock/unlock the package, an alternate approach could be to enable/disable the repo. In the case of apt it should be renaming the sources list file to .disabled or something. Perhaps this is preferred option to the wazuh team.

when:
- ansible_os_family|lower == "redhat"
- "'wazuh-agent' in ansible_facts.packages"
- not ansible_facts.packages['wazuh-agent'][0]['version'].startswith(wazuh_agent_version)

Choose a reason for hiding this comment

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

This could be computed in a fact since it is used twice.

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

Successfully merging this pull request may close these issues.

2 participants