Newer
Older
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
---
- name: install apt-transport-https
apt:
name: apt-transport-https
state: latest
- name: install elastic GPG key
apt_key:
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
state: present
- name: install elastic repository
apt_repository:
repo: deb https://artifacts.elastic.co/packages/7.x/apt stable main
- name: install metricbeat
apt:
name: metricbeat
state: latest
- name: install metricbeat configuration
template:
src: metricbeat.yml.j2
dest: /etc/metricbeat/metricbeat.yml
notify: restart metricbeat
- name: enable metricbeat dashboard
command: metricbeat setup
when: inventory_hostname == groups['mediaserver'][0]
- name: enable sql metricbeat configuration
template:
src: postgresql.yml.j2
dest: /etc/metricbeat/modules.d/postgresql.yml
when: "'postgres' in group_names"
notify: restart metricbeat
...