Ansible/playbook/linux/elastic/install-metricbeat.yml

45 lines
1.2 KiB
YAML

- 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
# - 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: '
- name: config where to send information
- 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