main.yml
744 Bytes
---
# tasks file for filebeat
# make sure user type YES
- name: "make sure user type YES to confirm"
fail:
msg: "user do not type YES"
when: confirmation != 'YES'
- name: "Create elastic yum repo file"
copy:
src: "elastic.repo"
dest: "/etc/yum.repos.d/elastic.repo"
# install filebeat
- name: ensure filebeat is installed
yum:
name: filebeat
state: installed
update_cache: yes
- name: update filebeat base configuration file
template:
src: "base.yml"
dest: "/etc/filebeat/filebeat-base.yml"
notify:
- restart filebeat-base
- name: update filebeat configuration file
template:
src: "{{ group }}.yml"
dest: "/etc/filebeat/filebeat-{{ group }}.yml"
notify:
- restart filebeat