|
|
---
|
|
|
# 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: Init filebeat folders
|
|
|
shell: mkdir -p /etc/filebeat /Data/logs/filebeat
|
|
|
|
...
|
...
|
@@ -22,25 +13,13 @@ |
|
|
src: "filebeat-5.6.4"
|
|
|
dest: "/usr/sbin/filebeat"
|
|
|
mode: 0755
|
|
|
notify:
|
|
|
- restart filebeat-base
|
|
|
- restart filebeat
|
|
|
|
|
|
- name: Clean nginx-access folder
|
|
|
shell: rm -rf /usr/share/filebeat/bin/data/nginx-access
|
|
|
notify:
|
|
|
- restart filebeat
|
|
|
|
|
|
- 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
|
|
|
- name: copy nginx filebeat config files and start filebeat
|
|
|
template:
|
|
|
src: "{{ config_group }}.yml"
|
|
|
dest: "/etc/filebeat/filebeat-{{ config_group }}.yml"
|
|
|
src: "{{ item }}.yml"
|
|
|
dest: "/etc/filebeat/filebeat-{{ item }}.yml"
|
|
|
with_items:
|
|
|
- nginx-access
|
|
|
- ufo-nginx-access
|
|
|
notify:
|
|
|
- restart filebeat |
...
|
...
|
|