freedomofpress.beats
Beats Client Ansible Role
This is an Ansible role for installing and setting up Elastic Beats clients. It's mainly used to send logs and metrics to an ELK stack. By default, it sends data to Logstash on the same server using Filebeat and Metricbeat.
Requirements
You will need a destination to send your data. With Beats version 5.x and later, this can include sending to file
, kafka
, redis
, console
, elasticsearch
, and/or logstash
.
Role Variables
You need an SSL certificate to encrypt logs while they are being sent to Logstash or Elasticsearch. This role doesn’t provide SSL setup or encryption by default. You will need to check the official Beats documentation to know how to add those options via variables.
Example Playbook
- name: Configure Beats clients
hosts: clients
roles:
- role: freedomofpress.beats
tags: clients
Running Tests
This role uses Molecule and Testinfra for testing. To run the tests:
pip install -r requirements.txt
molecule test
You can also run specific commands:
molecule idempotence
molecule verify
To start an Elasticsearch UI for debugging, use:
make elastic-ui
Refer to the Molecule documentation for more details.
Contributions
The following resources helped a lot in creating this role:
License
This project is licensed under the MIT License.
Deploys and configure Elastic beats
ansible-galaxy install freedomofpress.beats