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_arch
- 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_arch
- 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
Target system architecture of the binary
alertmanager_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' or ansible_architecture
== 'arm64' else 'amd64' }}"CPU shares with Docker deployment
alertmanager_cpu_shares:alertmanager_cpu_shares: '512'Data retention for alertmanager state
alertmanager_data_retention: 120hList of default folders to create
alertmanager_default_folders:
- /etc/alertmanager
- /etc/alertmanager/templates
- /var/lib/alertmanagerList 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:9093List 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/alertmanagerDomain for external access
alertmanager_domain:alertmanager_domain: https://alertmanager.example.comURL to the archive of the release to install
alertmanager_download:
https://github.com/prometheus/alertmanager/releases/download/v{{
alertmanager_version }}/alertmanager-{{ alertmanager_version }}.linux-{{
alertmanager_arch }}.tar.gzList of extra folders to create
alertmanager_extra_folders: []alertmanager_extra_folders:
- /path/to/host/folder1
- /path/to/host/folder2
- /path/to/host/folder3List 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:9093List 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/container3List of alerting groups
alertmanager_group_by: []alertmanager_group_by:
- alertname
- appDocker 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
- instanceSelect installation method, could be native or docker
alertmanager_installation: nativeListen address for the alertmanager
alertmanager_listen_address: 0.0.0.0:9093Memory limit with Docker deployment
alertmanager_memory_limit:alertmanager_memory_limit: 1024mSoft memory limit with Docker deployment
alertmanager_memory_soft_limit:alertmanager_memory_soft_limit: 512mSwap usage with Docker deployment
alertmanager_memory_swap:alertmanager_memory_swap: 2048mOptional 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: falseList of groups to allow access
alertmanager_oauth2_allowed_groups: []alertmanager_oauth2_allowed_groups:
- /Group1
- /Group2
- /Group3Target system architecture of the binary
alertmanager_oauth2_arch: '{{ alertmanager_arch }}'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:9092alertmanager_oauth2_download:
https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v{{
alertmanager_oauth2_version }}/oauth2-proxy-v{{ alertmanager_oauth2_version
}}.linux-{{ alertmanager_oauth2_arch }}.tar.gzURL of the OAuth2 Proxy to download
alertmanager_oauth2_enabled: falseList 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:9092Docker 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:9092Memory limit with Docker deployment
alertmanager_oauth2_memory_limit:alertmanager_oauth2_memory_limit: 1024mSoft memory limit with Docker deployment
alertmanager_oauth2_memory_soft_limit:alertmanager_oauth2_memory_soft_limit: 512mSwap usage with Docker deployment
alertmanager_oauth2_memory_swap:alertmanager_oauth2_memory_swap: 2048mOptional 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: keycloakPull 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: falseList 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: p455w0rdUpstream 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.15.1Pull image as part of the tasks
alertmanager_pull_image: trueStandard conect for alerts
alertmanager_receiver:List of alerting recipients
alertmanager_receivers: []alertmanager_receivers:
- name: mail-devops
email_configs:
- to: devops@example.com
send_resolved: trueList of alerting routes
alertmanager_routes: []alertmanager_routes:
- receiver: mail-devops
match:
severity: criticalSender for emails
alertmanager_smtp_from:Password for SMTP connection
alertmanager_smtp_password:Require TLS for SMTP connection
alertmanager_smtp_require_tls: trueHost 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/*.tmplVersion of the release to install
alertmanager_version: 0.31.1alertmanager
oauth2
Apache-2.0