Ansible role to install and configure journalbeat.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- journalbeat_config_combined
- journalbeat_config_inputs
- journalbeat_config_logging
- journalbeat_config_outputs
- journalbeat_config_procs
- journalbeat_console_enabled
- journalbeat_default_inputs
- journalbeat_default_processors
- journalbeat_group_inputs
- journalbeat_group_processors
- journalbeat_host_inputs
- journalbeat_host_processors
- journalbeat_keyring
- journalbeat_logging_level
- journalbeat_logging_selectors
- journalbeat_logging_to_files
- journalbeat_logstash_enabled
- journalbeat_logstash_hosts
- journalbeat_major_version
- journalbeat_name
- journalbeat_service_enabled
- journalbeat_tags
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
Combines the config components
journalbeat_config_combined: |
name: {{ journalbeat_name }}
tags: {{ journalbeat_tags | to_yaml | trim }}
{% if journalbeat_config_inputs | trim | default(False) %}
{{ journalbeat_config_inputs | trim }}
{% endif %}
{% if journalbeat_config_outputs | trim | default(False) %}
{{ journalbeat_config_outputs | trim }}
{% endif %}
{% if journalbeat_config_procs | trim | default(False) %}
{{ journalbeat_config_procs | trim }}
{% endif %}
{{ journalbeat_config_logging | trim }}
Config related to inputs
journalbeat_config_inputs: |
journalbeat.inputs:
{{ (journalbeat_default_inputs + journalbeat_group_inputs + journalbeat_host_inputs) | to_nice_yaml(indent=2) | indent(width=2, first=False) | trim }}
Config related to logging
journalbeat_config_logging: |
logging.level: {{ journalbeat_logging_level }}
logging.to_files: {{ journalbeat_logging_to_files | lower }}
logging.selectors: {{ journalbeat_logging_selectors | to_yaml | trim }}
Config related to outputs
journalbeat_config_outputs: |
{% if journalbeat_logstash_enabled %}
output.logstash:
enabled: {{ journalbeat_logstash_enabled | lower }}
hosts: {{ journalbeat_logstash_hosts | to_yaml | trim }}
{% endif %}
{% if journalbeat_console_enabled %}
output.console:
enabled: {{ journalbeat_console_enabled | lower }}
{% endif %}
Config related to processors
journalbeat_config_procs: |
{% if (journalbeat_default_processors + journalbeat_group_processors + journalbeat_host_processors) | length > 0 %}
processors:
{{ (journalbeat_default_processors + journalbeat_group_processors + journalbeat_host_processors) | to_nice_yaml(indent=2) | indent(width=2, first=False) | trim }}
{% endif %}
journalbeat_console_enabled: false
List of default inputs, gets directly transformed to yaml
journalbeat_default_inputs:
- paths: []
seek: cursor
List of default processors, gets directly transformed to yaml
journalbeat_default_processors:
- add_host_metadata:
- add_cloud_metadata:
- add_docker_metadata:
List of group inputs, merged with journalbeat_default_inputs
journalbeat_group_inputs: []
List of group processors, merged with journalbeat_default_processors
journalbeat_group_processors: []
List of host inputs, merged with journalbeat_default_inputs
journalbeat_host_inputs: []
List of host processors, merged with journalbeat_default_processors
journalbeat_host_processors: []
Path for the repository keyring
journalbeat_keyring: /usr/share/keyrings/elastic-archive-keyring.gpg
Define logging level
journalbeat_logging_level: warning
Define logging selectors, like beat, publish, service
journalbeat_logging_selectors: []
Log to files, keep journal clean
journalbeat_logging_to_files: true
journalbeat_logstash_enabled: true
journalbeat_logstash_hosts: []
Major version to install, used for the APT repository
journalbeat_major_version: 7
Name of the shipper within the output
journalbeat_name: '{{ ansible_hostname }}'
Enable the console output
List of tags to assign for the shipper
journalbeat_tags: []
journalbeat
- None
Apache-2.0