2019-04-30 10:03:30 -07:00
|
|
|
|
|
|
|
- name: Install elastic repo
|
|
|
|
include: install-repo.yml
|
|
|
|
|
|
|
|
- name: Install metricbeat from apt
|
2019-04-30 13:36:32 -07:00
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
apt:
|
|
|
|
name: metricbeat
|
|
|
|
|
|
|
|
- name: Update config
|
2019-04-30 13:36:32 -07:00
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
template:
|
|
|
|
src: metricbeat.j2
|
|
|
|
dest: /etc/metricbeat/metricbeat.yml
|
|
|
|
|
|
|
|
- name: enable system module
|
2019-04-30 13:36:32 -07:00
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
shell: metricbeat modules enable system
|
|
|
|
|
|
|
|
- name: systemd - daemon reload
|
2019-04-30 13:36:32 -07:00
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: Enable service on system startup
|
2019-04-30 13:36:32 -07:00
|
|
|
when: systemd_enable_service == true
|
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: systemd - restart Metricbeat
|
2019-04-30 13:36:32 -07:00
|
|
|
when: systemd_restart_service == true
|
|
|
|
become: true
|
2019-04-30 10:03:30 -07:00
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
state: restarted
|