/ansible-role-beats

Ansible role for installing and configuring elastic beats

Primary LanguageMakefile

Beats client Ansible role

CircleCI

Ansible role for installing and configuring elastic beats clients. Primarily used for shipping logs and metrics to an ELK stack. By default, this role will ship to logstash on the same box using filebeat and metricbeat.

Requirements

  • someplace to ship data to - as of the beats 5.x series this includes shipping to file, kafka, redis, console, elasticsearch, and/or logstash

Role Variables

You'll need an SSL cert to encrypt logs in transit to the logstash/elasticsearch. This logic is not provided by this role and encryption is not enabled by default. You'll need to reference the official beats documentation output guides to add those options via variables.

Example Playbook

- name: Configure beats clients.
  hosts: clients
  roles:
    - role: freedomofpress.beats
  tags: clients

Running the tests

This role uses Molecule and Testinfra for testing. To use it:

pip install -r requirements.txt
molecule test

You can also run selective commands:

molecule idempotence
molecule verify

To fire up an elasticsearch UI for debugging, run:

make elastic-ui

See the Molecule docs for more info.

Contributions

The following resources were invaluable in creating this role.

License

MIT