Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
add wechat configs vars (#42)
Browse files Browse the repository at this point in the history
[minor]
  • Loading branch information
soloradish authored and paulfantom committed Jun 21, 2018
1 parent 5ad858b commit 62c4861
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
| `alertmanager_opsgenie_api_host` | "" | Opsgenie webhook url |
| `alertmanager_hipchat_url` | "" | Hipchat webhook url |
| `alertmanager_hipchat_auth_token` | "" | Hipchat authentication token |
| `alertmanager_wechat_url` | "" | `Enterprise WeChat` webhook url |
| `alertmanager_wechat_secret` | "" | `Enterprise WeChat` secret token |
| `alertmanager_wechat_corp_id` | "" | `Enterprise WeChat` corporation id |
| `alertmanager_mesh` | {} | HA mesh network configuration |
| `alertmanager_receivers` | [] | A list of notification receivers. Configuration same as in [official docs](https://prometheus.io/docs/alerting/configuration/#<receiver>) |
| `alertmanager_inhibit_rules` | [] | List of inhibition rules. Same as in [official docs](https://prometheus.io/docs/alerting/configuration/#inhibit_rule) |
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ alertmanager_pagerduty_url: ''
alertmanager_opsgenie_api_host: ''
alertmanager_hipchat_url: ''
alertmanager_hipchat_auth_token: ''
alertmanager_wechat_url: ''
alertmanager_wechat_secret: ''
alertmanager_wechat_corp_id: ''

# First read: https://github.com/prometheus/alertmanager#high-availability
alertmanager_mesh: {}
Expand Down
9 changes: 9 additions & 0 deletions templates/alertmanager.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ global:
{% if alertmanager_hipchat_auth_token != '' %}
hipchat_auth_token: {{ alertmanager_hipchat_auth_token }}
{% endif %}
{% if alertmanager_wechat_url != '' %}
wechat_api_url: {{ alertmanager_wechat_url }}
{% endif %}
{% if alertmanager_wechat_secret != '' %}
wechat_api_secret: {{ alertmanager_wechat_secret }}
{% endif %}
{% if alertmanager_wechat_corp_id != '' %}
wechat_api_corp_id: {{ alertmanager_wechat_corp_id }}
{% endif %}
templates:
- '/etc/alertmanager/templates/*.tmpl'
{% if alertmanager_receivers != [] %}
Expand Down

0 comments on commit 62c4861

Please sign in to comment.