Filebeat role
This commit is contained in:
parent
c51b29fb05
commit
6a7f8ebe6d
12
filebeat/README.md
Normal file
12
filebeat/README.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# filebeat
|
||||||
|
|
||||||
|
Install Filebeat.
|
||||||
|
|
||||||
|
## Tasks
|
||||||
|
|
||||||
|
Everything is in the `tasks/main.yml` file.
|
||||||
|
|
||||||
|
## Available variables
|
||||||
|
|
||||||
|
* `filebeat_kibana_dashboards`: import dashboards in Kibana (defaults to false).
|
||||||
|
* `filebeat_logstash_plugin`: install Logstash plugin (defaults to false);
|
2
filebeat/defaults/main.yml
Normal file
2
filebeat/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
filebeat_kibana_dashboards: False
|
||||||
|
filebeat_logstash_plugin: False
|
52
filebeat/tasks/main.yml
Normal file
52
filebeat/tasks/main.yml
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: APT https transport is enabled
|
||||||
|
apt:
|
||||||
|
name: apt-transport-https
|
||||||
|
state: installed
|
||||||
|
tags:
|
||||||
|
- system
|
||||||
|
- packages
|
||||||
|
|
||||||
|
- name: Elastic GPG key is installed
|
||||||
|
apt_key:
|
||||||
|
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- system
|
||||||
|
- packages
|
||||||
|
|
||||||
|
- name: Elastic sources list is available
|
||||||
|
apt_repository:
|
||||||
|
repo: "deb https://artifacts.elastic.co/packages/5.x/apt stable main"
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- system
|
||||||
|
- packages
|
||||||
|
|
||||||
|
- name: Filebeat is installed
|
||||||
|
apt:
|
||||||
|
name: filebeat
|
||||||
|
update_cache: yes
|
||||||
|
state: installed
|
||||||
|
tags:
|
||||||
|
- packages
|
||||||
|
|
||||||
|
- name: Filebeat service is enabled
|
||||||
|
service:
|
||||||
|
name: filebeat
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: Kibana dashboards are imported
|
||||||
|
command: /usr/share/filebeat/scripts/import_dashboards
|
||||||
|
failed_when: '"fail" in stdout'
|
||||||
|
when: filebeat_kibana_dashboards
|
||||||
|
|
||||||
|
- name: is logstash-plugin available?
|
||||||
|
stat:
|
||||||
|
path: /usr/share/logstash/bin/logstash-plugin
|
||||||
|
register: logstash_plugin
|
||||||
|
|
||||||
|
- name: Logstash plugin is installed
|
||||||
|
command: /usr/share/logstash/bin/logstash-plugin install logstash-input-beats
|
||||||
|
when: filebeat_logstash_plugin and logstash_plugin.stat.exists
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
# - { role: apt-upgrade, apt_upgrade_mode: safe }
|
# - { role: apt-upgrade, apt_upgrade_mode: safe }
|
||||||
- apt-upgrade
|
# - apt-upgrade
|
||||||
- apt-backports
|
# - apt-backports
|
||||||
# - munin
|
# - munin
|
||||||
# - monit
|
# - monit
|
||||||
# - redis
|
# - redis
|
||||||
|
@ -24,4 +24,4 @@
|
||||||
# - { role: elasticsearch, elasticsearch_custom_tmpdir: "/var/lib/elasticsearch/tmp" }
|
# - { role: elasticsearch, elasticsearch_custom_tmpdir: "/var/lib/elasticsearch/tmp" }
|
||||||
# - elasticsearch
|
# - elasticsearch
|
||||||
# - elasticsearch-plugin-head
|
# - elasticsearch-plugin-head
|
||||||
- kibana
|
- filebeat
|
||||||
|
|
Loading…
Reference in a new issue