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

Fixes for wazuh-agent registration #406

Merged
merged 3 commits into from
Jun 19, 2020
Merged

Conversation

pchristos
Copy link
Contributor

Review each commit separately. Read commit messages.

Check whether an error was returned by the HTTP POST to the `agents/`
endpoint before invoking `/var/ossec/bin/manage_agents` in order to
register a new agent.

It seems like that if an agent has already been registered under the
given name, the HTTP POST will return an error that'll cause the next
task, which is meant to retrieve the agent information, to be skipped.
That'll cause the agent registration task to fail in return. Instead,
this change will cause the aforementioned task to be skipped, too. So,
if an agent has already been successfully registered and the playbook
is re-run, it'll run all the way to the end.

If anything goes wrong (during the registration process) and the agent
fails to start, the `restart wazuh-agent` handler will still fail.
of the wazuh-agent playbook to allow one to perform either manager
or agent verification, or both.
@jm404
Copy link
Contributor

jm404 commented Apr 13, 2020

Hi @pchristos,

We will test the changes and let you know the results.

Thanks for contributing, it's really appreciated!

Best regards,

Jose

@jm404 jm404 changed the base branch from master to devel April 27, 2020 07:16
@manuasir manuasir added this to the Sprint - 111 - DevOps milestone May 11, 2020
@manuasir manuasir requested a review from Zenidd May 11, 2020 15:42
@manuasir manuasir mentioned this pull request Jun 19, 2020
@manuasir manuasir merged commit 03ba9c0 into wazuh:devel Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants