Go to file
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
playbooks Rule paths are now relative to playbooks 2020-03-24 12:42:45 +01:00
roles Make agent registration via the rest API idempotent 2020-04-11 02:15:42 +03:00
.gitignore deleted .swp 2019-07-17 12:52:14 +02:00
.yamllint changing permissions 2019-07-17 12:21:19 +02:00
CHANGELOG.md Changelog minor fix 2020-03-25 18:20:30 +01:00
LICENSE changing permissions 2019-07-17 12:21:19 +02:00
README.md Removed molecule from root folder 2019-09-18 15:35:29 +02:00
VERSION Bump version 2020-03-05 16:44:02 +01:00

Wazuh-Ansible

Slack Email Documentation Documentation

These playbooks install and configure Wazuh agent, manager and Elastic Stack.

Documentation

Directory structure

├── wazuh-ansible
│ ├── roles
│ │ ├── elastic-stack 
│ │ │ ├── ansible-elasticsearch        
│ │ │ ├── ansible-kibana
│ │
│ │ ├── wazuh                
│ │ │ ├── ansible-filebeat
│ │ │ ├── ansible-wazuh-manager
│ │ │ ├── ansible-wazuh-agent
│ │
│ │ ├── ansible-galaxy
│ │ │ ├── meta
│
│ ├── playbooks
│ │ ├── wazuh-agent.yml
│ │ ├── wazuh-elastic.yml
│ │ ├── wazuh-elastic_stack-distributed.yml
│ │ ├── wazuh-elastic_stack-single.yml
│ │ ├── wazuh-kibana.yml
│ │ ├── wazuh-manager.yml
│
│ ├── README.md
│ ├── VERSION
│ ├── CHANGELOG.md

Branches

  • stable branch on correspond to the last Wazuh-Ansible stable version.
  • master branch contains the latest code, be aware of possible bugs on this branch.

Testing

  1. Get the wazuh-ansible folder from the wazuh-qa repository.
git clone https://github.com/wazuh/wazuh-qa
  1. Copy the Pipfile and the molecule folder into the root wazuh-ansible directory:
cp wazuh-qa/ansible/wazuh-ansible/* . -R
  1. Follow these steps for launching the tests. Check the Pipfile for running different scenarios:
pip install pipenv
sudo pipenv install
pipenv run test
pipenv run agent

Contribute

If you want to contribute to our repository, please fork our Github repository and submit a pull request.

If you are not familiar with Github, you can also share them through our users mailing list, to which you can subscribe by sending an email to wazuh+subscribe@googlegroups.com.

Modified by Wazuh

The playbooks have been modified by Wazuh, including some specific requirements, templates and configuration to improve integration with Wazuh ecosystem.

Credits and Thank you

Based on previous work from dj-wasabi.

https://github.com/dj-wasabi/ansible-ossec-server

WAZUH Copyright (C) 2016-2018 Wazuh Inc. (License GPLv2)

Web references