main.yml
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- name: Playbook para instalar elasticsearch
hosts: elasticsearch
become: true
roles:
- role: elk-prerequisitos
- name: Install Elasticsearch
hosts: elasticsearch
become: true
roles:
- role: elasticsearch
vars:
repo_url: "http://10.9.3.54/repo/"
rpm_name: "elasticsearch-7.15.2-x86_64.rpm"
discovery_seed_hosts: '["10.9.3.68"]' # configurar el master tambien para esto
elastic_master_ip: "10.9.3.68"
- name: Playbook para instalar Kibana
hosts: kibana
become: true
roles:
- role: kibana
vars:
repo_url: "http://10.9.3.54/repo/"
rpm_name: "kibana-7.15.2-x86_64.rpm"
elasticsearch_hosts: '["http://10.9.3.68:9200"]' # donde se publica el kibana
- name: Playbook para instalar beats
hosts: beat
become: true
tasks:
- name: Install beats
include_role:
name: beat
vars:
- beat_name: "{{ item.beat_name }}"
- rpm_name: "{{ item.rpm_name }}"
- elastic_master_ip: 192.168.102.224
- repo_url: "http://10.9.3.54/repo/"
loop:
- {rpm_name: metricbeat-7.15.2-x86_64.rpm, beat_name: metricbeat}
- {rpm_name: filebeat-7.15.2-x86_64.rpm, beat_name: filebeat}
- {rpm_name: packetbeat-7.15.2-x86_64.rpm, beat_name: packetbeat}