Added Windows support for metricbeat
This commit is contained in:
parent
76e0466edf
commit
fde241d31b
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
---
|
||||
|
||||
- name: Install Metricbeat
|
||||
|
@ -1,12 +1,18 @@
|
||||
---
|
||||
# defaults file for luther38.metricbeat
|
||||
|
||||
|
||||
# Defines the kibana host we will send data to
|
||||
kibana_host: 127.0.0.1
|
||||
|
||||
# Example: '["172.0.0.1:9200"]'
|
||||
elasticsearch_hosts: '["172.0.0.1:9200"]'
|
||||
|
||||
# tells ansible to enable the service on startup
|
||||
systemd_enable_service: true
|
||||
|
||||
# Tells ansible to restart the service after everything has been done
|
||||
systemd_restart_service: true
|
||||
|
||||
# Defines the version of metricbeat to install.
|
||||
# Currently used for Windows
|
||||
version: 7.0.0
|
||||
|
@ -4,3 +4,7 @@
|
||||
- name: Install Metricbeat on Ubuntu
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
include: ubuntu.yml
|
||||
|
||||
- name: Install Metricbeat on Windows
|
||||
when: ansible_distribution == 'Windows'
|
||||
include: windows.yml
|
||||
|
32
roles/luther38.metricbeat/tasks/windows.yml
Normal file
32
roles/luther38.metricbeat/tasks/windows.yml
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
# This will install metricbeat on a windows host.
|
||||
---
|
||||
- name: make temp folder
|
||||
win_file:
|
||||
path: c:\tmp\
|
||||
state: directory
|
||||
|
||||
- name: download metricbeat
|
||||
win_get_url:
|
||||
url: '{{ url_metricbeat }}'
|
||||
dest: 'C:\temp\metricbeat-{{ version }}.zip'
|
||||
force: no
|
||||
|
||||
- name: unzip metricbeat
|
||||
win_unzip:
|
||||
src: c:\temp\metricbeat-{{ version }}.zip
|
||||
dest: C:\temp\metricbeat-{{ version }}\
|
||||
creates: C:\temp\metricbeat-{{ version }}\
|
||||
|
||||
- name: Copy metricbeat-{{ version }} folder
|
||||
win_command: powershell.exe copy-item -Path 'c:\temp\metricbeat-{{ version }}\heartbeat-{{ version }}-windows-x86_64\' -Filter * -Recurse -Destination 'C:\Program Files\Metricbeat\'
|
||||
args:
|
||||
creates: C:\Program Files\Metricbeat\
|
||||
|
||||
- name: Update template
|
||||
win_template:
|
||||
src: metricbeat.j2
|
||||
dest: C:\Program Files\Metricbeat\metricbeat.yml
|
||||
|
||||
- name: Install Metricbeat service
|
||||
win_command: powershell.exe -ExecutionPolicy ByPass -File 'C:\Program Files\Metricbeat\install-service-metricbeat.ps1'
|
Loading…
Reference in New Issue
Block a user