2019-04-22 15:01:56 -07:00
|
|
|
|
|
|
|
# - name: enable modules
|
|
|
|
|
|
|
|
- name: define kibana host
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/metricbeat/metricbeat.yml
|
2019-04-23 12:21:00 -07:00
|
|
|
regexp: 'host: "localhost:5601"'
|
|
|
|
#insertafter: '#host: "localhost:5601"'
|
|
|
|
line: ' host: "192.168.0.173:5601"'
|
|
|
|
state: present
|
|
|
|
backrefs: yes
|
2019-04-22 15:32:56 -07:00
|
|
|
|
|
|
|
- name: define elasticsearch host
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/metricbeat/metricbeat.yml
|
2019-04-23 12:21:00 -07:00
|
|
|
regexp: 'hosts: \["localhost:9200"\]'
|
|
|
|
#insertafter: '#hosts: ["localhost:9200"]'
|
|
|
|
line: ' hosts: ["192.168.0.173:9200"]'
|
|
|
|
state: present
|
|
|
|
backrefs: yes
|
2019-04-22 15:32:56 -07:00
|
|
|
|
2019-04-23 12:21:00 -07:00
|
|
|
- name: enable system module
|
|
|
|
become: true
|
|
|
|
shell: metricbeat modules enable system
|
|
|
|
|
|
|
|
- name: run metricbeat setup
|
|
|
|
become: true
|
|
|
|
shell: metricbeat setup
|
|
|
|
|
|
|
|
- name: start metricbeat service
|
|
|
|
become: true
|
|
|
|
shell: metricbeat service metricbeat start
|
2019-04-22 15:32:56 -07:00
|
|
|
|
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
|