-
Notifications
You must be signed in to change notification settings - Fork 2
/
30_MetricBeat_StackMonitor.yml
89 lines (77 loc) · 2.06 KB
/
30_MetricBeat_StackMonitor.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Eyes of Log - Deploy MetricBeat
# Axians - Brice VALENZA
---
- name: Install MetricBeat on Eyes of Log
hosts: elasticsearch_nodes:kibana_nodes
vars:
tasks:
- name: Install Metricbeat | Ensure all pre-requisites packages are installed
become: yes
yum:
name: "metricbeat"
state: present
- name: Install Metricbeat | Copy certificates
become: yes
copy:
src: "files/certs/{{ item }}"
dest: /etc/metricbeat/certs/
owner: root
group: root
mode: '0644'
loop:
- "{{ inventory_hostname }}_privatekey.pem"
- "{{ inventory_hostname }}.crt"
- "{{ eol.cluster.eol_ca_cert_name }}"
- name: Install Metricbeat | Configure application
become: yes
template:
src: templates/metricbeat.j2
dest: /etc/metricbeat/metricbeat.yml
owner: root
group: root
mode: '0644'
notify: restart metricbeat
handlers:
- name: restart metricbeat
become: yes
systemd:
name: metricbeat
state: restarted
- name: Activate Elasticsearch Monitoring
hosts: elasticsearch_nodes
vars:
tasks:
- name: Metricbeat | Configure module elasticsearch
become: yes
template:
src: templates/metricbeat_elasticsearch-xpack.j2
dest: /etc/metricbeat/modules.d/elasticsearch-xpack.yml
owner: root
group: root
mode: '0644'
notify: restart metricbeat
handlers:
- name: restart metricbeat
become: yes
systemd:
name: metricbeat
state: restarted
- name: Activate Kibana Monitoring
hosts: kibana_nodes
vars:
tasks:
- name: Metricbeat | Configure module kibana
become: yes
template:
src: templates/metricbeat_kibana-xpack.j2
dest: /etc/metricbeat/modules.d/kibana-xpack.yml
owner: root
group: root
mode: '0644'
notify: restart metricbeat
handlers:
- name: restart metricbeat
become: yes
systemd:
name: metricbeat
state: restarted