This role installs Beats products on a Ubuntu machine.
This role is capable of installing beats products available as deb packages. However, for configuring beats products (e.g filebeat.yml, metricbeat.yml) the only supported products so far are:
- filebeat
- metricbeat
None
You should specify the version for the Beats products you want to install with the beats_version
variable (default: 6.7.2).
beats_version: 6.7.2
You also need to specify the products you want to install in a list variable called beats_products
(default: []):
beats_products:
- filebeat
- metricbeat
If you want to hold beats packages on APT so they don't get updated (default: true) you can use the beats_hold_products
variable:
beats_hold_products: true
If you want to also configure the products on the fly you will need to create a variable with the product name plus _config:
which should be a dictionary containing the YAML config for the product you choose. E.G:
filebeat_config:
filebeat.modules:
- module: system
syslog:
enabled: true
output.logstash.hosts:
- logstash.server:5044
metricbeat_config:
metricbeat.modules:
- module: system
metricsets: ["cpu","memory","network"]
enabled: true
period: 15s
processes: ['.*']
output.logstash.hosts:
- logstash.server:5044
The specific values for the configuration are well described in the beats documentation
There is no dependencies
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
become: true
roles:
- role: jobscore.beats
beats_version: 6.7.2
beats_products:
- filebeat
- metricbeat
filebeat_config:
filebeat.modules:
- module: system
syslog:
enabled: true
output.logstash.hosts:
- logstash.server:5044
metricbeat_config:
metricbeat.modules:
- module: system
metricsets: ["cpu","memory","network"]
enabled: true
period: 15s
processes: ['.*']
output.logstash.hosts:
- logstash.server:5044
GPLv3
This role was created by Eric Magalhães