Tom
3d1197fddc
Change min_ansible_version
The role doesn't work with ansible 2.7.18 : ``` TASK [prometheus : prometheus | include asserts] ************************************************************************************************************** fatal: [host]: FAILED! => {"reason": "no action detected in task. This often indicates a misspelled module name, or incorrect module path.\n\nThe error appears to have been in '/usr/local/ansible/orchestrator/roles/prometheus/tasks/asserts.yml': line 9, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: 'prometheus | assert | gather the package facts'\n ^ here\n"} ``` Ansible 2.8.20 is OK.
prometheus
The present role :
- installs prometheus server inside a Docker container
- installs various prometheus exporter
It has been tested on :
- Debian 9
- Debian 10
Role variables
Variable | Type | Choices | Default | Comment |
---|---|---|---|---|
prometheus_server_enable | string | true / false | ||
prometheus_server_version | string | latest | ||
prometheus_server_monitor | string | |||
prometheus_server_global_scrape_interval | string | 15 | ||
prometheus_server_global_evaluation_interval | string | 15 | ||
prometheus_server_job_name | string | prometheus | ||
prometheus_server_scrape_interval | string | 5 | ||
prometheus_server_scrape_timeout | string | 5 | ||
prometheus_exporter_packages | list | node / mysqld / postgresql / mongodb / phpfpm / apache / haproxy / varnish / redis | ||
prometheus_node_exporter_targets | list | |||
prometheus_mysqld_exporter_targets | list | |||
prometheus_mongodb_exporter_targets | list | |||
prometheus_postgres_exporter_targets | list | |||
prometheus_redis_exporter_targets | list | |||
prometheus_proxysql_exporter_targets | list | Enable exporter | ||
prometheus_mysqld_exporter_user | string | |||
prometheus_mysqld_exporter_password | string | |||
prometheus_mongodb_exporter_host | string | localhost | ||
prometheus_mongodb_exporter_port | string | 27017 | ||
prometheus_mongodb_exporter_user | string | |||
prometheus_mongodb_exporter_pass | string | |||
prometheus_server_version | string | latest | ||
prometheus_redis_exporter_addr | string | redis://localhost:6379 | ||
prometheus_redis_exporter_user | string | |||
prometheus_redis_exporter_password | string |
Dependencies
- jq
- Docker must installed and running for prometheus server
Example Playbook
- hosts: prometheus
ignore_errors: "{{ ansible_check_mode }}" # ignore errors only in check mode !
roles:
- { role: brainsys.prometheus, tags: ['prometheus'] }
Example variables
---
prometheus_server_enable: 'true'
prometheus_server_monitor: 'example'
prometheus_exporter_packages:
- node
- mysqld
prometheus_mysqld_exporter_user: 'foo'
prometheus_mysqld_exporter_password: 'bar'
prometheus_node_exporter_targets:
- server01
- server02
prometheus_mysqld_exporter_targets:
- server01
TODO
License
GPLv3
Author Information
Written by Ludovic Cartier ludovic.cartier@brainsys.io
Description
Languages
Jinja
100%