metricbeat for linux is working

need to add windows installer.
This commit is contained in:
James Tombleson 2019-04-30 13:36:32 -07:00
parent 341caa5a78
commit 76e0466edf
5 changed files with 39 additions and 7 deletions

View 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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