wazuh-ansible-4.8.1/roles/wazuh/ansible-wazuh-agent/tasks
Christos Pollalis f6e020631e Make agent registration via the rest API idempotent
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.
2020-04-11 02:15:42 +03:00
..
Debian.yml Update Agent conditionals to make them work with custom packages install 2020-02-19 18:10:26 +01:00
installation_from_custom_packages.yml Fix conditionals error related with AL2 custom packages installation 2020-03-03 13:14:13 +01:00
installation_from_sources.yml Removing readall perms in certs files. Minor syntax normalizations 2020-03-17 18:21:33 +01:00
Linux.yml Make agent registration via the rest API idempotent 2020-04-11 02:15:42 +03:00
main.yml Switch agent to include_tasks 2019-11-11 16:07:00 +01:00
RedHat.yml Fix trailing whitespace in RedHat.yml tasks from Agent 2020-02-19 18:11:39 +01:00
RMDebian.yml changing permissions 2019-07-17 12:21:19 +02:00
RMRedHat.yml changing permissions 2019-07-17 12:21:19 +02:00
Windows.yml Merge branch 'master' into wazuh-release-v3.12.0_7.6.1 2020-03-24 19:20:51 +01:00