-
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.
Merge branch 'main' into feature/contact-points
- Loading branch information
Showing
8 changed files
with
147 additions
and
97 deletions.
There are no files selected for viewing
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,3 @@ | ||
--- | ||
minor_changes: | ||
- add org switch by `org_id` and `org_name` in `grafana_silence` |
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
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
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
83 changes: 83 additions & 0 deletions
83
tests/integration/targets/grafana_silence/tasks/create-delete.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,83 @@ | ||
--- | ||
- module_defaults: | ||
community.grafana.grafana_silence: | ||
url: "{{ grafana_url }}" | ||
url_username: "{{ grafana_username }}" | ||
url_password: "{{ grafana_password }}" | ||
block: | ||
- name: Create new silence | ||
community.grafana.grafana_silence: | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: present | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == true" | ||
- "result.failed == false" | ||
- "result.silence.id != ''" | ||
|
||
- name: Check idempotency on silence creation | ||
community.grafana.grafana_silence: | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: present | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == false" | ||
- "result.msg != ''" | ||
|
||
- name: Delete the silence | ||
community.grafana.grafana_silence: | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: absent | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == true" | ||
- "result.failed == false" | ||
- "result.silence.id != ''" | ||
- - "result.silence.createdBy != 'me'" | ||
|
||
- name: Check idempotency on silence deletion | ||
community.grafana.grafana_silence: | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: absent | ||
register: result | ||
ignore_errors: yes | ||
- assert: | ||
that: | ||
- "result.changed == false" | ||
- "result.failed == false" | ||
- "result.msg == 'Silence does not exist'" |
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 |
---|---|---|
@@ -1,89 +1,6 @@ | ||
--- | ||
- name: Create new silence | ||
community.grafana.grafana_silence: | ||
url: "{{ grafana_url }}" | ||
url_username: "{{ grafana_username }}" | ||
url_password: "{{ grafana_password }}" | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: present | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == true" | ||
- "result.failed == false" | ||
- "result.silence.id != ''" | ||
- name: Silence creation and deletion | ||
ansible.builtin.include_tasks: create-delete.yml | ||
|
||
- name: Check idempotency on silence creation | ||
community.grafana.grafana_silence: | ||
url: "{{ grafana_url }}" | ||
url_username: "{{ grafana_username }}" | ||
url_password: "{{ grafana_password }}" | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: present | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == false" | ||
- "result.msg != ''" | ||
|
||
- name: Delete the silence | ||
community.grafana.grafana_silence: | ||
url: "{{ grafana_url }}" | ||
url_username: "{{ grafana_username }}" | ||
url_password: "{{ grafana_password }}" | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: absent | ||
register: result | ||
- assert: | ||
that: | ||
- "result.changed == true" | ||
- "result.failed == false" | ||
- "result.silence.id != ''" | ||
- - "result.silence.createdBy != 'me'" | ||
|
||
- name: Check idempotency on silence deletion | ||
community.grafana.grafana_silence: | ||
url: "{{ grafana_url }}" | ||
url_username: "{{ grafana_username }}" | ||
url_password: "{{ grafana_password }}" | ||
comment: "a testcomment" | ||
created_by: "me" | ||
starts_at: "2029-07-29T08:45:45.000Z" | ||
ends_at: "2029-07-29T08:55:45.000Z" | ||
matchers: | ||
- isEqual: true | ||
isRegex: true | ||
name: environment | ||
value: test | ||
state: absent | ||
register: result | ||
ignore_errors: yes | ||
- assert: | ||
that: | ||
- "result.changed == false" | ||
- "result.failed == false" | ||
- "result.msg == 'Silence does not exist'" | ||
- name: Silence creation and deletion for organization | ||
ansible.builtin.include_tasks: org.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 @@ | ||
--- | ||
- module_defaults: | ||
community.grafana.grafana_silence: | ||
org_name: Main Org. | ||
block: | ||
- name: Silence creation and deletion | ||
ansible.builtin.include_tasks: create-delete.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