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

Add refreshonly option #1265

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Add refreshonly option #1265

merged 2 commits into from
Feb 24, 2025

Conversation

vcerenu
Copy link
Member

@vcerenu vcerenu commented Feb 24, 2025

This PR adds refreshonly option for apt update command because the command execution should only be executed when changes have been made to the repository configuration files, in order to maintain the idempotence of the class.

The command's operation was tested before and after the class execution to verify its operation.

Before the change:

root@master1:~# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet:8140 (127.0.2.1)
Notice: Catalog compiled by master1
Info: Caching catalog for master1
Info: Applying configuration version '1740415593'
Notice: /Stage[repo]/Wazuh::Repo/Exec[apt-update]/returns: executed successfully (corrective)
Notice: Applied catalog in 3.58 seconds
root@master1:~#

After the change:

root@master1:~# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet:8140 (127.0.2.1)
Notice: Catalog compiled by master1
Info: Caching catalog for master1
Info: Applying configuration version '1740415702'
Notice: Applied catalog in 4.50 seconds
root@master1:~#

@vcerenu vcerenu requested a review from a team February 24, 2025 17:47
@vcerenu vcerenu self-assigned this Feb 24, 2025
@c-bordon c-bordon merged commit b4a2fad into 4.11.1 Feb 24, 2025
4 of 5 checks passed
@c-bordon c-bordon deleted the refreshonly_apt_update branch February 24, 2025 18:07
@vcerenu vcerenu linked an issue Feb 24, 2025 that may be closed by this pull request
@poloz-lab
Copy link
Contributor

It's a little bit weird because nothing refreshes this Exec resource.

I would suggest to add a notify at least in the apt::source

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.

Idempotency is broken
3 participants