Fixed manager check in distributed deployment #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes: #51
The aim of this PR is to fix the Wazuh manager service check distributed deployments. The fix consists in changing the credentials when getting the API token in the Wazuh manager worker nodes. These nodes are installed after the master node, and the master node changes the API passwords, so the worker node must use the changed password.
Apart from the fix, a new validation has been added to the loop to check that the API token is not empty. The new validation controls if the API generates a cluster error, which is produced when the master and worker nodes are installed simultaneously. This scenario is not contemplated in the documentation, as the manager nodes are installed sequentially. However, with this improvement, the Wazuh manager installation will not fail if the nodes are installed simultaneously, for example, when using an Ansible playbook.
Testing
Testing is in: #51 (comment)