Skip to content

slashpai/ansible-prometheus-msteams

Repository files navigation

Ansible role prometheus-msteams

build markdown links Ansible Role GitHub tag

ansible-prometheus-msteams

To install and configure prometheus-msteams for sending notifications from alertmanager to microsoft teams

Synopsis

This role was created to install and configure prometheus-msteams when I figured out there is no direct way we can use microsoft teams as receiver in alertmanager config. I didn't find any existing ansible role for this thats how this role was created. This role is inspired from ansible-node-exporter.

Requirements

  • Ansible >= 2.9 (Earlier versions may work, but I haven't tested)

Role Variables

All variables in default/main.yml can be overrided

Name Default Value Description
prometheus_msteams_version latest prometheus-msteams version to install
prometheus_msteams_binary_local_dir "" To allow to use local packages from controller machine instead of github packages
prometheus_msteams_template_local_dir "" To allow to use local teams card template on controller machine than from github
prometheus_msteams_config_dir "/etc/prometheus_msteams" Location to store server configs
prometheus_msteams_web_listen_address "0.0.0.0:2000" prometheus_msteams listen addrress
prometheus_msteams_request_uri "alertmanager" teams-request-uri
prometheus_msteams_channels [] Channels to which alerts to send from alert manager

Dependencies

Nil

Usage

From galaxy

ansible-galaxy install slashpai.ansible_prometheus_msteams

git submodule

To add as submodule to your project instead of pulling from galaxy

git submodule add -b main https://github.com/slashpai/ansible-prometheus-msteams.git roles/prometheus-msteams

To get role updates

git submodule update --remote

Example Playbook

- hosts: all
  roles:
    - slashpai.ansible_prometheus_msteams

Example playbook using git submodule

Contributing

  • Fork the project on GitHub
  • Clone the project
  • Add changes (and tests)
  • Commit and push
  • Create a pull request

TODO

  • Add tests for ubuntu and figure out which inspec version to use due to licencing difference

License

MIT