This role:
- installs metricbeat on Ubuntu, CentOS
- copies prepared configuration file (log path, connect to elasticsearch etc.)
- Prepare server (add elastic repo)
- Install metricbeat
- [Optional] Copy configuration file
- [Optional] Enable modules
- Minimal Version of the ansible for installation: 2.9
- Supported OS:
- CentOS
- 7,8
- Ubuntu
- 16.04, 18.04
- Debian
- 8, 9
- CentOS
You can override any variable below by setting "variable: value" in playbook.
elastic_gpg_key
GPG-key from elasticsearch repository. Default value ishttps://artifacts.elastic.co/GPG-KEY-elasticsearch
elastic_gpg_key_redhat
GPG-key from elasticsearch repository. Default value ishttps://packages.elastic.co/GPG-KEY-elasticsearch
metricbeat_config
Custom config for metricbeatmetricbeat_modules
Specify which modules will be enabled. By default only system module enabled
metricbeat_service_name
Name of nssm\init script, which manages filebeat service
Nothing
- name: Install metricbeat
hosts: all
roles:
- role: ansible-role-metricbeat
- name: Install metricbeat
hosts: all
roles:
- role: ansible-role-metricbeat
vars:
metricbeat_modules:
- system
- jolokia
- name: Install metricbeat
hosts: all
roles:
- role: ansible-role-metricbeat
vars:
metricbeat_config: {
"metricbeat.config.modules": {
"path": '${path.config}/modules.d/*.yml',
"reload.enabled": false
},
"output.elasticsearch": {
"hosts": ["localhost:9200"],
"#username": "elastic",
"#password": "changeme"
},
"#output.logstash": {
"#hosts": ["localhost:5044"]
}
}
- name: Install metricbeat
hosts: all
roles:
- role: ansible-role-metricbeat
vars:
metricbeat_modules:
- system
- jolokia
module_config:
- module: jolokia
metricsets: ["jmx"]
period: 10s
hosts: ["localhost:9999"]
namespace: "metrics"
path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
http_method: "POST"
jmx.mappings:
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
Apache
authors:
- Lean Delivery Team [email protected]