metricbeat for linux is working
need to add windows installer.
This commit is contained in:
parent
341caa5a78
commit
76e0466edf
18
playbook/linux/elastic/install-metricbeat.yml
Normal file
18
playbook/linux/elastic/install-metricbeat.yml
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
---
|
||||
|
||||
- name: Install Metricbeat
|
||||
hosts: elasticClients
|
||||
|
||||
tasks:
|
||||
- name: Install Metricbeat
|
||||
become: true
|
||||
include_role:
|
||||
name: luther38.metricbeat
|
||||
vars:
|
||||
kibana_host: 172.20.0.142
|
||||
elasticsearch_hosts: '["172.20.0.142:9200"]'
|
||||
systemd_enable_service: true
|
||||
systemd_restart_service: true
|
||||
|
@ -1,2 +1,12 @@
|
||||
---
|
||||
# defaults file for luther38.metricbeat
|
||||
# defaults file for luther38.metricbeat
|
||||
|
||||
|
||||
kibana_host: 127.0.0.1
|
||||
|
||||
# Example: '["172.0.0.1:9200"]'
|
||||
elasticsearch_hosts: '["172.0.0.1:9200"]'
|
||||
|
||||
systemd_enable_service: true
|
||||
|
||||
systemd_restart_service: true
|
||||
|
@ -17,10 +17,7 @@
|
||||
copy:
|
||||
dest: '/etc/apt/sources.list.d/elastic-7.x.list'
|
||||
content: "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
|
||||
# copy:
|
||||
#src: elastic-7.x.list
|
||||
# dest: /etc/apt/sources.list.d/
|
||||
# backup: yes
|
||||
|
||||
|
||||
- name: Update Packages
|
||||
become: true
|
||||
|
@ -2,6 +2,5 @@
|
||||
# tasks file for luther38.metricbeat
|
||||
|
||||
- name: Install Metricbeat on Ubuntu
|
||||
become: true
|
||||
when:: ansible_distribution == 'Ubuntu'
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
include: ubuntu.yml
|
||||
|
@ -3,27 +3,35 @@
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user