-
Notifications
You must be signed in to change notification settings - Fork 145
Hotfix exec when wazuh-template.json do not exist #551
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
Hotfix exec when wazuh-template.json do not exist #551
Conversation
Ensure that we recognize content changes of the local and remote file.
|
Hi @cruelsmith , I tried your hotfix and the exec is applied at every puppet run. I don't have idempotency.
It seems that as the onlif is true, the unless is not evaluated. Do you experience the same behaviour ? |
Fix case where file does not exist so rm will not be called Fix sh incompatible process substitution <(...) can be used with bash but not with sh that exec uses.
ecdbe52 to
8b9cb4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 thanks for the hint @poloz-lab
Note for myself: Trust only tests you did yourself and always ensure you using the right shell when testing the command on the shell.
To make it short the exec from #516 had never worked it always had raised a syntax error and even not it had raised a path missing for command curl. 🤦(to myself)
Now it is really tested. Working in the states if file is missing, file differ from upstream via curl and file is equal with upstream with curl. The exec to remove the file only runs when the file differ and setting the content with the mtime will only be set when file was missing.
vcerenu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c-bordon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested
Pull Request (PR) description
In #516 has been an error introduced that blocks the bootstrap of the filebeat wazuh plugin. This PR add the missing condition to not removing the will when it does not exist.
This PR differ from #543 since it is just a hotfix. The other PR is still the better solution for the feature but changes the current update management of this file.
This Pull Request (PR) fixes the following issues
Closes #542