Role Detail

cloudalchemy.alertmanager

Prometheus Alertmanager service
Downloads
336
Type Ansible
Minimum Ansible Version 2.3
Installation $ ansible-galaxy install cloudalchemy.alertmanager
Tags
alert
alerting
monitoring
prometheus
Last Commit
Last Imported
Version History
Version Release Date
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.5
0.1.6
0.1.3
0.1.4
0.1.2
0.1.1
0.1.0
0.0.4
0.0.3
0.0.2
0.0.1
OS Platforms
Platform Version
Debian jessie
Debian stretch
EL 7
Fedora 27
Ubuntu bionic
Ubuntu xenial
Last 10 Imports
Completed Status
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS

alert logo

Ansible Role: alertmanager

Build Status License Ansible Role GitHub tag IRC

Description

Deploy and manage Prometheus alertmanager service using ansible.

Requirements

  • Ansible >= 2.3

It would be nice to have prometheus installed somewhere

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in table below.

Name Default Value Description
alertmanager_version 0.14.0 Alermanager package version
alertmanager_listen_address '0.0.0.0:9093' Address on which alertmanager will be listening
alertmanager_external_url 'http://localhost:9093/' External address on which alertmanager is available. Useful when behind reverse proxy. Ex. example.org/alertmanager
alertmanager_root_dir /opt/alertmanager Path to directory with alertmanager and amtool binaries
alertmanager_config_dir /etc/alertmanager Path to directory with alertmanager configuration
alertmanager_db_dir /var/lib/alertmanager Path to directory with alertmanager database
alertmanager_config_file 'alertmanager.yml.j2' Variable used to provide custom alertmanager configuration file in form of ansible template
alertmanager_config_flags_extra {} Additional configuration flags passed to prometheus binary at startup
alertmanager_resolve_timeout 3m Time after which an alert is declared resolved
alertmanager_smtp {} SMTP (email) configuration
alertmanager_slack_api_url "" Slack webhook url
alertmanager_pagerduty_url "" Pagerduty webhook url
alertmanager_opsgenie_api_host "" Opsgenie webhook url
alertmanager_hipchat_url "" Hipchat webhook url
alertmanager_hipchat_auth_token "" Hipchat authentication token
alertmanager_mesh {} HA mesh network configuration
alertmanager_receivers [] A list of notification receivers. Configuration same as in official docs
alertmanager_inhibit_rules [] List of inhibition rules. Same as in official docs
alertmanager_route {} Alert routing. More in official docs
alertmanager_child_routes [] List of child routes.

Example

Playbook

- hosts: all
  roles:
    - cloudalchemy.alertmanager

Demo site

We provide demo site for full monitoring solution based on prometheus and grafana. Repository with code and links to running instances is available on github and site is hosted on DigitalOcean.

Local Testing

The preferred way of locally testing the role is to use Docker and molecule (v2.x). You will have to install Docker on your system. See Get started for a Docker package suitable to for your system. All packages you need to can be specified in one line:

pip install ansible 'ansible-lint>=3.4.15' 'molecule>2.13.0' docker 'testinfra>=1.7.0' jmespath

This should be similar to one listed in .travis.yml file in install section. After installing test suit you can run test by running

molecule test --all

For more information about molecule go to their docs.

Travis CI

Combining molecule and travis CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix (42 parallel role executions in case of ansible-prometheus) which will take more time than local testing, so please be patient.

Contributing

See contributor guideline.

License

This project is licensed under MIT License. See LICENSE for more details.

None