Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Ansible Node Exporter | 503 | a month ago | mit | Python | ||||||
Provision basic metrics exporter for prometheus monitoring tool | ||||||||||
Ansible Prometheus | 257 | 3 years ago | 12 | mit | Shell | |||||
An Ansible role that installs Prometheus, in the format for Ansible Galaxy. | ||||||||||
Ansible Alertmanager | 142 | a month ago | mit | Jinja | ||||||
Deploy Prometheus Alertmanager service | ||||||||||
Azure_metrics_exporter | 95 | 2 years ago | 33 | apache-2.0 | Go | |||||
Azure metrics exporter for Prometheus | ||||||||||
Ansible Prometheus Node Exporter | 83 | a year ago | 8 | gpl-2.0 | Shell | |||||
Ansible role for deploying Prometheus node exporter | ||||||||||
Ansible Prometheus | 69 | 7 years ago | 1 | |||||||
Ansible role for installing Prometheus monitoring server and node_exporter binary | ||||||||||
Ansible Blackbox Exporter | 60 | a month ago | mit | Python | ||||||
Blackbox prober exporter | ||||||||||
Ansible Role Linux Prometheus | 55 | 8 months ago | mit | Jinja | ||||||
Ansible role for install and configure standalone or distributed Prometheus v2 with long term storage capabilities on Linux operating system. | ||||||||||
Ansible Role Node_exporter | 54 | 2 months ago | 3 | mit | Jinja | |||||
Ansible role - Node exporter | ||||||||||
Kubecost Quickstart | 39 | 4 years ago | 1 | Smarty | ||||||
Quickly install kube-state-metrics, prometheus, and grafana on your cluster with helm. |
Role name in Ansible Galaxy: william-yeh.prometheus
This Ansible role has the following features for Prometheus:
To keep this role simple, this role only installs 3 components: Prometheus server, Node exporter, and Alertmanager. Use the following roles if you want to install other Prometheus exporters:
Supports for Ubuntu 12.04 (Precise) and CentOS 6 have been ended since Nov 2018.
The components to be installed:
# Supported components:
#
# [Server components]
# - "prometheus"
# - "alertmanager"
#
# [Exporter components]
# - "node_exporter"
#
prometheus_components
User-configurable defaults:
# user and group
prometheus_user: prometheus
prometheus_group: prometheus
# directory for executable files
prometheus_install_path: /opt/prometheus
# directory for configuration files
prometheus_config_path: /etc/prometheus
# directory for logs
prometheus_log_path: /var/log/prometheus
# directory for PID files
prometheus_pid_path: /var/run/prometheus
# directory for temporary files
prometheus_download_path: /tmp
# version of helper utility "gosu"
gosu_version: "1.11"
If the Linux distributions are equipped with systemd, this role will use this mechanism accordingly. You can disable this (i.e., use traditional SysV-style init script) by defining the following variable(s) to false
:
prometheus_use_systemd
User-configurable defaults:
# which version?
prometheus_version: 2.5.0
# directory for rule files
prometheus_rule_path: {{ prometheus_config_path }}/rules
# directory for file_sd files
prometheus_file_sd_config_path: {{ prometheus_config_path }}/tgroups
# directory for runtime database
prometheus_db_path: /var/lib/prometheus
User-installable configuration file (see doc for details):
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/prometheus.yml"
prometheus_conf_main
User-installable rule files (see doc for details):
# rule files to be installed to "{{ prometheus_rule_path }}" directory;
# dict fields:
# - key: memo for this rule
# - value:
# - src: file relative to `playbook_dir`
# - dest: target file relative to `{{ prometheus_rule_path }}`
prometheus_rule_files
Alertmanager to be triggered:
prometheus_alertmanager_hostport
Additional command-line arguments, if any (use prometheus --help
to see the full list of arguments):
prometheus_opts
User-configurable defaults:
# which version?
prometheus_node_exporter_version: 0.16.0
Additional command-line arguments, if any (use node_exporter --help
to see the full list of arguments):
prometheus_node_exporter_opts
User-configurable defaults:
# which version?
prometheus_alertmanager_version: 0.15.3
# directory for runtime database (currently for `silences.json`)
prometheus_alertmanager_db_path: /var/lib/alertmanager
User-installable alertmanager conf file (see doc for details):
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/alertmanager.yml"
prometheus_alertmanager_conf
Additional command-line arguments, if any (use alertmanager --help
to see the full list of arguments):
prometheus_alertmanager_opts
(Credit: Robbie Trencheny)
For aforementioned prometheus_components
, you can optionally download/compile from the master branch of Prometheus repositories by setting the respective version to git
.
It will install a temporary Golang compiler in the prometheus_workdir
directory (defined in defaults/main.yml
).
For example, get the latest code for all components by assigning all *_version
variables to git
:
prometheus_version: git
prometheus_node_exporter_version: git
prometheus_alertmanager_version: git
If you'd like to force rebuild each time, enable the following variable (default is false
):
prometheus_rebuild: true
Prometheus server:
restart prometheus
reload prometheus
stop prometheus
Node exporter:
restart node_exporter
reload node_exporter
(actually, the same as restart
)
stop node_exporter
Alertmanager:
restart alertmanager
reload alertmanager
stop alertmanager
Add role name william-yeh.prometheus
to your playbook file.
Set vars in your playbook file, if necessary.
Simple example:
---
# file: simple-playbook.yml
- hosts: all
become: True
roles:
- william-yeh.prometheus
vars:
prometheus_components: [ "prometheus", "alertmanager" ]
prometheus_alertmanager_hostport: "localhost:9093"
More practical example:
---
# file: complex-playbook.yml
- hosts: all
become: True
roles:
- william-yeh.prometheus
vars:
prometheus_components:
- prometheus
- node_exporter
- alertmanager
prometheus_rule_files:
this_is_rule_1_InstanceDown:
src: some/path/basic.rules
dest: basic.rules
prometheus_alertmanager_conf: some/path/alertmanager.yml.j2
Open the page in your browser:
Prometheus - http://HOST:9090
or http://HOST:9090/consoles/node.html
Alertmanager - http://HOST:9093
None.
MIT License. See the LICENSE file for details.