Set up common prometheus configurations
- src: [email protected]:smartlogic/ansible-role-prometheus
name: prometheus
version: 0.6.1
- PostgreSQL 10
- A PostgreSQL user that has full permissions on the database prometheus will be using
- This assumes a local connection
If enabled, this will set up two PostgreSQL extensions: pg_prometheus and timescaledb. prometheus-postgresql-adapter will also be set up as a service.
prometheus_version
- Which version of prometheus to downloadprometheus_checksum
- The checksum for the version of prometheusprometheus_extra_flags
- Variable to place on the command line, after the config file loadalertmanager_version
- Which version of alertmanager to downloadalertmanager_checksum
- The checksum for the version of alertmanageralertmanager_extra_flags
- Variable to place on the command line, after the config file loadgrafana_ini_file
- The file to use forgrafana.ini
- Default:
grafana.ini
- Default:
grafana_state
- The state of the apt package for grafana (present|latest)- Default:
present
- Default:
prometheus_config_file
- The file to use forprometheus.yml
- Default:
prometheus.yml.j2
- Default:
prometheus_alert_file
- The file to use foralertmanager.yml
- Default:
alertmanager.yml
- Default:
alertmanager_enabled
- boolean - True for enabling the alertmanager, via systemctl- Default:
true
- Default:
prometheus
- Configure scrape files, alert rules, and alert templatesprometheus_postgresql_archive
- boolean - If true the postgresql adapter will be installed- Default:
false
- Default:
prometheus_postgresql_adapter_host
- The host that the adapter will be running on, how Prometheus will find it- Default:
localhost
- Default:
prometheus_postgresql_database
- Database that the adapter will use- Default:
metrics
- Default:
prometheus_postgresql_username
- User that the adapter will connect as- Default:
prometheus
- Default:
prometheus_postgresql_password
- Password that the adapter will connect with- Default:
prometheus
- Default:
None
grafana_ini_file: "{{ playbook_dir }}/files/grafana.ini"
prometheus_config_file: "{{ playbook_dir }}/files/prometheus.yml"
prometheus_alert_file: "{{ playbook_dir }}/files/alertmanager.yml"
prometheus_postgresql_archive: true
prometheus_postgresql_database: metrics
prometheus_postgresql_username: prometheus
prometheus:
jobs:
- "{{ playbook_dir }}/file_config/project.json"
alert:
rules:
- "{{ playbook_dir }}/alert_rules/rules.yml"
templates:
- "{{ playbook_dir }}/alert_templates/templte.tmpl"
Full setup:
- hosts: servers
roles:
- { role: prometheus, action: "full" }
MIT
SmartLogic. https://smartlogic.io