Ansible role to install and configure Alertmanager.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- alertmanager_cpu_shares
- alertmanager_data_retention
- alertmanager_default_folders
- alertmanager_default_labels
- alertmanager_default_publish
- alertmanager_default_templates
- alertmanager_default_volumes
- alertmanager_domain
- alertmanager_download
- alertmanager_extra_folders
- alertmanager_extra_labels
- alertmanager_extra_publish
- alertmanager_extra_templates
- alertmanager_extra_volumes
- alertmanager_group_by
- alertmanager_image
- alertmanager_inhibit_rules
- alertmanager_installation
- alertmanager_listen_address
- alertmanager_memory_limit
- alertmanager_memory_soft_limit
- alertmanager_memory_swap
- alertmanager_network
- alertmanager_number_of_cpus
- alertmanager_oauth2_access_logging
- alertmanager_oauth2_allowed_groups
- alertmanager_oauth2_client_id
- alertmanager_oauth2_client_secret
- alertmanager_oauth2_cookie_secret
- alertmanager_oauth2_cpu_shares
- alertmanager_oauth2_default_labels
- alertmanager_oauth2_default_publish
- alertmanager_oauth2_download
- alertmanager_oauth2_enabled
- alertmanager_oauth2_extra_labels
- alertmanager_oauth2_extra_publish
- alertmanager_oauth2_image
- alertmanager_oauth2_keycloak_url
- alertmanager_oauth2_listen_address
- alertmanager_oauth2_memory_limit
- alertmanager_oauth2_memory_soft_limit
- alertmanager_oauth2_memory_swap
- alertmanager_oauth2_network
- alertmanager_oauth2_number_of_cpus
- alertmanager_oauth2_provider
- alertmanager_oauth2_pull_image
- alertmanager_oauth2_request_logging
- alertmanager_oauth2_static_groups
- alertmanager_oauth2_static_users
- alertmanager_oauth2_upstream
- alertmanager_oauth2_version
- alertmanager_pull_image
- alertmanager_receiver
- alertmanager_receivers
- alertmanager_routes
- alertmanager_smtp_from
- alertmanager_smtp_password
- alertmanager_smtp_require_tls
- alertmanager_smtp_smarthost
- alertmanager_smtp_username
- alertmanager_template_paths
- alertmanager_version
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
CPU shares with Docker deployment
alertmanager_cpu_shares:
alertmanager_cpu_shares: '512'
Data retention for alertmanager state
alertmanager_data_retention: 120h
List of default folders to create
alertmanager_default_folders:
- /etc/alertmanager
- /etc/alertmanager/templates
- /var/lib/alertmanager
List of default labels to assign to docker
alertmanager_default_labels: []
List of default port publishing for docker
alertmanager_default_publish: []
alertmanager_default_publish:
- 127.0.0.1:9093:9093
List of default template file definition
alertmanager_default_templates: []
List of default volumes to mount for docker
alertmanager_default_volumes:
- /var/lib/alertmanager:/var/lib/alertmanager
- /etc/alertmanager:/etc/alertmanager
Domain for external access
alertmanager_domain:
alertmanager_domain: https://alertmanager.example.com
URL to the archive of the release to install
alertmanager_download: https://github.com/prometheus/alertmanager/releases/download/v{{
alertmanager_version }}/alertmanager-{{ alertmanager_version }}.linux-amd64.tar.gz
List of extra folders to create
alertmanager_extra_folders: []
alertmanager_extra_folders:
- /path/to/host/folder1
- /path/to/host/folder2
- /path/to/host/folder3
List of extra labels to assign to docker
alertmanager_extra_labels: []
List of extra port publishing for docker
alertmanager_extra_publish: []
alertmanager_extra_publish:
- 127.0.0.1:9093:9093
List of extra template file definition
alertmanager_extra_templates: []
List of extra volumes to mount for docker
alertmanager_extra_volumes: []
alertmanager_extra_volumes:
- /path/to/host/folder1:/path/within/container1
- /path/to/host/folder2:/path/within/container2
- /path/to/host/folder3:/path/within/container3
List of alerting groups
alertmanager_group_by: []
alertmanager_group_by:
- alertname
- app
Docker image to use for deployment
alertmanager_image: quay.io/prometheus/alertmanager:v{{ alertmanager_version }}
List of alerting recipients
alertmanager_inhibit_rules: []
alertmanager_inhibit_rules:
- source_match:
severity: critical
target_match:
severity: 'warning'
equal:
- alertname
- dev
- instance
Select installation method, could be native or docker
alertmanager_installation: native
Listen address for the alertmanager
alertmanager_listen_address: 0.0.0.0:9093
Memory limit with Docker deployment
alertmanager_memory_limit:
alertmanager_memory_limit: 1024m
Soft memory limit with Docker deployment
alertmanager_memory_soft_limit:
alertmanager_memory_soft_limit: 512m
Swap usage with Docker deployment
alertmanager_memory_swap:
alertmanager_memory_swap: 2048m
Optional docker network to attach
alertmanager_network:
Number of CPUs with Docker deployment
alertmanager_number_of_cpus:
alertmanager_number_of_cpus: '1.0'
Enable access logging for OAuth2 proxy
alertmanager_oauth2_access_logging: false
List of groups to allow access
alertmanager_oauth2_allowed_groups: []
alertmanager_oauth2_allowed_groups:
- /Group1
- /Group2
- /Group3
Client ID for OAuth2 authentication
alertmanager_oauth2_client_id:
Client secret for OAuth2 authentication
alertmanager_oauth2_client_secret:
Cookie secret used by OAuth2 proxy
alertmanager_oauth2_cookie_secret:
CPU shares with Docker deployment
alertmanager_oauth2_cpu_shares:
alertmanager_oauth2_cpu_shares: '512'
List of default labels to assign to docker on OAuth2 Proxy
alertmanager_oauth2_default_labels: []
List of default port publishing for docker on OAuth2 Proxy
alertmanager_oauth2_default_publish: []
alertmanager_oauth2_default_publish:
- 127.0.0.1:9092:9092
alertmanager_oauth2_download: https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v{{
alertmanager_oauth2_version }}/oauth2-proxy-v{{ alertmanager_oauth2_version }}.linux-amd64.tar.gz
URL of the OAuth2 Proxy to download
alertmanager_oauth2_enabled: false
List of extra labels to assign to docker on OAuth2 Proxy
alertmanager_oauth2_extra_labels: []
List of extra port publishing for docker on OAuth2 Proxy
alertmanager_oauth2_extra_publish: []
alertmanager_oauth2_extra_publish:
- 127.0.0.1:9092:9092
Docker image to use for deployment
alertmanager_oauth2_image: quay.io/oauth2-proxy/oauth2-proxy:v{{ alertmanager_oauth2_version
}}
URL of the Keycloak realm
alertmanager_oauth2_keycloak_url:
Listem address for the OAuth2 proxy
alertmanager_oauth2_listen_address: 0.0.0.0:9092
Memory limit with Docker deployment
alertmanager_oauth2_memory_limit:
alertmanager_oauth2_memory_limit: 1024m
Soft memory limit with Docker deployment
alertmanager_oauth2_memory_soft_limit:
alertmanager_oauth2_memory_soft_limit: 512m
Swap usage with Docker deployment
alertmanager_oauth2_memory_swap:
alertmanager_oauth2_memory_swap: 2048m
Optional docker network to attach on OAuth2 Proxy
alertmanager_oauth2_network: '{{ alertmanager_network }}'
Number of CPUs with Docker deployment
alertmanager_oauth2_number_of_cpus:
alertmanager_oauth2_number_of_cpus: '1.0'
Provider for OAuth2 authentication
alertmanager_oauth2_provider: keycloak
Pull OAuth2 Proxy image as part of the tasks
alertmanager_oauth2_pull_image: '{{ alertmanager_pull_image }}'
Enable request logging for OAuth2 proxy
alertmanager_oauth2_request_logging: false
List of groups assigned to static users
alertmanager_oauth2_static_groups: []
List of users to allow access
alertmanager_oauth2_static_users: []
alertmanager_oauth2_static_users:
- username: username1
password: p455w0rd
- username: username2
password: p455w0rd
- username: username3
password: p455w0rd
Upstream target for the OAuth2 proxy
alertmanager_oauth2_upstream: http://{{ alertmanager_listen_address if alertmanager_installation
== 'native' else 'alertmanager:9093' }}
Version of the OAuth2 Proxy to download
alertmanager_oauth2_version: 7.7.1
Pull image as part of the tasks
alertmanager_pull_image: true
Standard conect for alerts
alertmanager_receiver:
List of alerting recipients
alertmanager_receivers: []
alertmanager_receivers:
- name: mail-devops
email_configs:
- to: [email protected]
send_resolved: True
List of alerting routes
alertmanager_routes: []
alertmanager_routes:
- receiver: mail-devops
match:
severity: critical
Sender for emails
alertmanager_smtp_from:
Password for SMTP connection
alertmanager_smtp_password:
Require TLS for SMTP connection
alertmanager_smtp_require_tls: true
Host for SMTP connection
alertmanager_smtp_smarthost:
Username for SMTP connection
alertmanager_smtp_username:
List of template paths for alertmanager
alertmanager_template_paths:
- /etc/alertmanager/templates/*.tmpl
Version of the release to install
alertmanager_version: 0.27.0
alertmanager
oauth2
Apache-2.0