2019-04-19 12:52:07 -07:00
|
|
|
|
|
|
|
- name: Install Metricbeat
|
|
|
|
hosts: elastic
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Download metricbeat deb
|
|
|
|
get_url:
|
|
|
|
url: 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.0.0-amd64.deb'
|
|
|
|
dest: /tmp/metricbeat.deb
|
|
|
|
|
|
|
|
- name: Install metricbeat
|
|
|
|
become: true
|
|
|
|
apt:
|
|
|
|
deb: /tmp/metricbeat.deb
|
|
|
|
|
2019-04-19 16:15:04 -07:00
|
|
|
# - name: enable modules
|
|
|
|
|
|
|
|
- name: define kibana host:
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/metricbeat/metricbeat.yml
|
|
|
|
regex: '^host: "localhost:5601"'
|
|
|
|
insertafter: '#host: "localhost:5601"'
|
|
|
|
line: 'host: '
|
2019-04-19 12:52:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
- name: config where to send information
|
2019-04-19 16:15:04 -07:00
|
|
|
|
|
|
|
- name: systemd - daemon reload
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: Enable service on system startup
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
enabed: yes
|
|
|
|
|
|
|
|
- name: systemd - restart Metricbeat
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
state: restarted
|