2019-04-22 15:01:56 -07:00
|
|
|
|
|
|
|
# - name: enable modules
|
|
|
|
|
|
|
|
- name: define kibana host
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/metricbeat/metricbeat.yml
|
|
|
|
regex: '^host: "dm-nagios.local:5601"'
|
|
|
|
insertafter: '#host: "localhost:5601"'
|
|
|
|
line: 'host: "dm-nagios.local:5601"'
|
|
|
|
|
|
|
|
#- name: config where to send information
|
|
|
|
|
2019-04-22 15:32:56 -07:00
|
|
|
#- name: Remove builtin elasticsearch host config
|
|
|
|
# become: true
|
|
|
|
# replace:
|
|
|
|
#dest: /etc/metricbeat/metricbeat.yml
|
|
|
|
#regexp: '^hosts: ["localhost:9200"]'
|
|
|
|
#replace: '#hosts: ["localhost:9200"]'
|
|
|
|
|
|
|
|
- name: define elasticsearch host
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/metricbeat/metricbeat.yml
|
|
|
|
regex: '^hosts: ["localhost:9200"]'
|
|
|
|
insertafter: 'hosts: ["localhost:9200"]'
|
|
|
|
line: 'hosts: ["dm-nagios.local:9200"]'
|
|
|
|
|
|
|
|
|
2019-04-22 15:01:56 -07:00
|
|
|
- name: systemd - daemon reload
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: Enable service on system startup
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: systemd - restart Metricbeat
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: metricbeat
|
|
|
|
state: restarted
|