https://github.com/elan-ev/monitoring_alertmanager
Ansible role to install the alertmanager
https://github.com/elan-ev/monitoring_alertmanager
alertmanager ansible ansible-role monitoring prometheus
Last synced: 3 months ago
JSON representation
Ansible role to install the alertmanager
- Host: GitHub
- URL: https://github.com/elan-ev/monitoring_alertmanager
- Owner: elan-ev
- License: bsd-3-clause
- Created: 2021-07-14T15:24:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-14T15:53:24.000Z (about 3 years ago)
- Last Synced: 2025-02-25T10:46:43.863Z (3 months ago)
- Topics: alertmanager, ansible, ansible-role, monitoring, prometheus
- Language: Jinja
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Role for the alertmanager

Install the latest [alertmanager](https://github.com/prometheus/alertmanager) version with [ansible](https://docs.ansible.com/).
This role is the multi-os ansible equivalent of https://github.com/lkiesow/prometheus-rpm.## Role Variables
You can specify which template files to use for your configuration.
The role installs the default configuration, which you will likely want to extend or change
(see the [alertmanager config options](https://github.com/prometheus/alertmanager#example) for that).
To pass your own configuration file, specify the path to the jinja template in the variable `alertmanager_config_template`.Additionally, an `.env`-file is installed that expands the command line arguments of how prometheus is called by systemd.
Here you can also pass your individual file via the variable `alertmanager_env_file`, so you are not limited to these values.Keep in mind that you also need to specify the alert rules in your prometheus config.
## Example Playbook
Just add the role to your playbook:
```yaml
- hosts: all
become: true
roles:
- role: elan.monitoring_alertmanager
alertmanager_config_template: 'custom_templates/alertmanager.yml.j2'
```## Development
For development and testing you can use [molecule](https://molecule.readthedocs.io/en/latest/).
With podman as driver you can install it like this – preferably in a virtual environment (if you use docker, substitute `podman` with `docker`):```bash
pip install -r .dev_requirements.txt
```Then you can *create* the test instances, apply the ansible config (*converge*) and *destroy* the test instances with these commands:
```bash
molecule create
molecule converge
molecule destroy
```If you want to inspect a running test instance use `molecule login --host `, where you replace `` with the desired value.
## License
[BSD-3-Clause](LICENSE)
## Author Information
[ELAN e.V](https://elan-ev.de/)