Ansible/roles/luther38.metricbeat/tasks/ubuntu.yml

38 lines
736 B
YAML
Raw Normal View History

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