Ansible/roles/luther38.metricbeat/tasks/ubuntu.yml
2019-04-30 13:36:32 -07:00

38 lines
736 B
YAML

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