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: copy:
dest: '/etc/apt/sources.list.d/elastic-7.x.list' dest: '/etc/apt/sources.list.d/elastic-7.x.list'
content: "deb https://artifacts.elastic.co/packages/7.x/apt stable main" 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 - name: Update Packages
become: true become: true

View File

@ -2,6 +2,5 @@
# tasks file for luther38.metricbeat # tasks file for luther38.metricbeat
- name: Install Metricbeat on Ubuntu - name: Install Metricbeat on Ubuntu
become: true when: ansible_distribution == 'Ubuntu'
when:: ansible_distribution == 'Ubuntu'
include: ubuntu.yml include: ubuntu.yml

View File

@ -3,27 +3,35 @@
include: install-repo.yml include: install-repo.yml
- name: Install metricbeat from apt - name: Install metricbeat from apt
become: true
apt: apt:
name: metricbeat name: metricbeat
- name: Update config - name: Update config
become: true
template: template:
src: metricbeat.j2 src: metricbeat.j2
dest: /etc/metricbeat/metricbeat.yml dest: /etc/metricbeat/metricbeat.yml
- name: enable system module - name: enable system module
become: true
shell: metricbeat modules enable system shell: metricbeat modules enable system
- name: systemd - daemon reload - name: systemd - daemon reload
become: true
systemd: systemd:
daemon_reload: yes daemon_reload: yes
- name: Enable service on system startup - name: Enable service on system startup
when: systemd_enable_service == true
become: true
systemd: systemd:
name: metricbeat name: metricbeat
enabled: yes enabled: yes
- name: systemd - restart Metricbeat - name: systemd - restart Metricbeat
when: systemd_restart_service == true
become: true
systemd: systemd:
name: metricbeat name: metricbeat
state: restarted state: restarted