James Tombleson
bdba44c56d
not finished with winlogbeat but config template is stored for now. Checking the status of the service to know what order to issue
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
---
|
|
# This will install all the client parts needed for elastic to monitor client computers
|
|
|
|
- name: download winlogbeat
|
|
win_get_url:
|
|
url: '{{ url_winlogbeat }}'
|
|
dest: 'C:\temp\winlogbeat-{{ elastic_version }}.zip'
|
|
force: no
|
|
|
|
- name: unzip winlogbeat
|
|
win_unzip:
|
|
src: c:\temp\winlogbeat-{{ elastic_version }}.zip
|
|
dest: C:\temp\winlogbeat-{{ elastic_version }}\
|
|
creates: C:\temp\winlogbeat-{{ elastic_version }}\
|
|
|
|
- name: Copy winlogbeat-{{ elastic_version }} folder
|
|
win_command: powershell.exe copy-item -Path 'c:\temp\winlogbeat-{{ elastic_version }}\metricbeat-{{ elastic_version }}-windows-x86_64\' -Filter * -Recurse -Destination 'C:\Program Files\winlogbeat\'
|
|
args:
|
|
creates: C:\Program Files\winlogbeat\
|
|
|
|
- name: Update template
|
|
win_template:
|
|
src: winlogbeat.j2
|
|
dest: C:\Program Files\winlogbeat\winlogbeat.yml
|
|
|
|
- name: Install winlogbeat service
|
|
win_command: powershell.exe -ExecutionPolicy ByPass -File install-service-winlogbeat.ps1
|
|
args:
|
|
chdir: C:\program files\winlogbeat\
|
|
|
|
- name: restart service
|
|
win_service:
|
|
name: winlogbeat
|
|
state: restarted
|
|
|
|
- name: start service
|
|
win_service:
|
|
name: winlogbeat
|
|
state: started
|