lean_delivery.winlogbeat
winlogbeat role
Summary
This role:
- installs winlogbeat on Windows
- copies prepared configuration file (log path, connect to elasticsearch etc.)
Role tasks
- [Optional] Create folder(s) for custom paths
- Install winlogbeat
- Copy configuration file
Requirements
- Minimal Version of the ansible for installation: 2.8
- Supported OS:
- Windows
- 2016
- 2019
- Windows
Role Variables
You can override any variable below by setting "variable: value" in playbook.
winlogbeat_versionIs used to select main Winlogbeat branch to be installed. Default value is7.winlogbeat_last_versionIs used to select specific Winlogbeat version to be installed. Default value is7.4.2winlogbeat_node_nameName of the winlogbeat node. Default value is{{ inventory_hostname }}. If this options is not defined, the hostname is used.winlogbeat_ssl_enabledTurns on/off SSL connection between winlogbeat and logstash/elasticsearch. SSL options should be set by corresponding dict fields like shown below:
ssl:
key: 'c:\tls\private\server.key'
certificate: 'c:\tls\certs\server.pem'
certificate_authorities: 'c:\CA\ca-root.pem'
The path section of the configuration options defines where Winlogbeat looks for its files. For example, Winlogbeat looks for the Elasticsearch template file in the configuration path and writes log files in the logs path. Winlogbeat looks for its registry files in the data path. Default values for Linux host are set up this way:
path:
home: 'c:\program files\winlogbeat'
config: 'c:\program files\winlogbeat'
data: 'c:\programdata\winlogbeat'
logs: 'c:\programdata\winlogbeat\logs'
win_download_pathTemp directory for Windows to download and upzip Winlogbeat package. Default value is'{{ ansible_env.TEMP }}/winlogbeat'(ansible_env.TEMP value solves idempotence issue)
Output customization:
winlogbeat_outputIs used to configure what output to use when sending data (elasticsearchorlogstash). Default value iselasticsearchelasticsearch.hostArray of hosts to connect to. Default value islocalhostelasticsearch.portValue for setting custom port. Default value is9200logstash.hostArray of hosts to connect to. Default value islocalhostlogstash.portValue for setting custom port. Default value is5044
Advanced config parameters:
The winlogbeat(systemd)\initd section of the configuration options defines which init script will be used to manage winlogbeat service depending on the *nix OS. Custom paths will be taken into account (if configured).
winlogbeat_service_nameName of nssm\init script, which manages winlogbeat servicewinlogbeat_bulk_max_sizeMaximum number of events to bulk in a single Logstash request. Default value is500winlogbeat_workerNumber of workers per Elasticsearch host. Default value is1winlogbeat_logging_to_syslogSend all logging output to syslog. Default value isfalsewinlogbeat_logging_to_filesSend all logging output to rotating files. Default value istruewinlogbeat_rotateeverybytesDefines log file size limit. Defalt value is104857600=100MBwinlogbeat_keepfilesNumber of log files to keep. Default value is30winlogbeat_ignore_olderValue (any time strings like 2h, 5m can be used) above which logs will be ignored. Default value is0(disabled)winlogbeat_lognameName of the logging files. Default value is"winlogbeat.log"
Dependencies
ca-cert (only for installation with SSL)
Example Playbook
Installing Winlogbeat 7.x version:
- name: Install winlogbeat
hosts: all
roles:
- role: lean_delivery.winlogbeat
License
Apache
Author Information
authors:
- Lean Delivery Team team@lean-delivery.com
Ansible role for installing Winlogbeat.
ansible-galaxy install lean_delivery.winlogbeat