-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial notification channel support
- Loading branch information
Showing
21 changed files
with
1,534 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
tests/integration/targets/grafana_notification_channel/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
grafana_url: "http://grafana:3000" | ||
grafana_username: "admin" | ||
grafana_password: "admin" | ||
|
||
... |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/dingding.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create dingding notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: dingding | ||
name: dingding | ||
type: dingding | ||
dingding_url: https://example.org | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete dingding notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: dingding | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/discord.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create discord notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: discord | ||
name: discord | ||
type: discord | ||
discord_url: https://example.org | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete discord notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: discord | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
38 changes: 38 additions & 0 deletions
38
tests/integration/targets/grafana_notification_channel/tasks/email.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
- name: Create email notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: email | ||
name: email | ||
type: email | ||
email_addresses: | ||
- [email protected] | ||
- [email protected] | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete discord notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: email | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/googlechat.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create googlechat notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: googlechat | ||
name: googlechat | ||
type: googlechat | ||
googlechat_url: https://example.org | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete googlechat notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: googlechat | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/hipchat.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create hipchat notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: hipchat | ||
name: hipchat | ||
type: hipchat | ||
hipchat_url: https://example.org | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete hipchat notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: hipchat | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
37 changes: 37 additions & 0 deletions
37
tests/integration/targets/grafana_notification_channel/tasks/kafka.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- name: Create kafka notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: kafka | ||
name: kafka | ||
type: kafka | ||
kafka_url: https://example.org | ||
kafka_topic: test | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete kafka notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: kafka | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/line.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create line notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: line | ||
name: line | ||
type: line | ||
line_token: xxx | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete line notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: line | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
20 changes: 20 additions & 0 deletions
20
tests/integration/targets/grafana_notification_channel/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- block: | ||
# - include: dingding.yml | ||
# - include: discord.yml | ||
# - include: email.yml | ||
# - include: googlechat.yml | ||
# - include: hipchat.yml | ||
# - include: kafka.yml | ||
# - include: line.yml | ||
# - include: teams.yml | ||
# - include: opsgenie.yml | ||
# - include: pagerduty.yml | ||
# - include: prometheus.yml | ||
# - include: pushover.yml | ||
# - include: sensu.yml | ||
- include: slack-and-beyond.yml | ||
- include: telegram.yml | ||
- include: threema.yml | ||
- include: victorops.yml | ||
- include: webhook.yml |
37 changes: 37 additions & 0 deletions
37
tests/integration/targets/grafana_notification_channel/tasks/opsgenie.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- name: Create opsgenie notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: opsgenie | ||
name: opsgenie | ||
type: opsgenie | ||
opsgenie_url: https://example.org | ||
opsgenie_api_key: xxx | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete opsgenie notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: opsgenie | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
36 changes: 36 additions & 0 deletions
36
tests/integration/targets/grafana_notification_channel/tasks/pagerduty.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create pagerduty notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: pagerduty | ||
name: pagerduty | ||
type: pagerduty | ||
pagerduty_integration_key: xxx | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'present'" | ||
|
||
- name: Delete pagerduty notification channel | ||
register: result | ||
grafana_notification_channel: | ||
uid: pagerduty | ||
state: absent | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password}}" | ||
|
||
- debug: | ||
var: result | ||
|
||
- assert: | ||
that: | ||
- "result.changed == True" | ||
- "result.state == 'absent'" |
Oops, something went wrong.