Skip to content

Commit

Permalink
feat: initial support of contact point module in grafana role
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed Feb 29, 2024
1 parent 1bbb45b commit 0dbf2d6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ action_groups:
- grafana_datasource
- grafana_folder
- grafana_notification_channel
- grafana_contact_point
- grafana_organization
- grafana_organization_user
- grafana_plugin
Expand Down
10 changes: 10 additions & 0 deletions roles/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use
| webhook_password | no |
| webhook_url | no |
| webhook_username | no |
| [**grafana_contact_point**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_contact_point_module.html) |
| email_addresses | no |
| email_single | no |
| is_default | no |
| name | yes |
| org_id | no |
| org_name | no |
| state | no |
| type | yes |
| uid | no |

## Example Playbook

Expand Down
1 change: 1 addition & 0 deletions roles/grafana/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ grafana_datasources: []
grafana_folders: []
grafana_dashboards: []
grafana_notification_channels: []
grafana_contact_points: []
15 changes: 15 additions & 0 deletions roles/grafana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@
loop_control: {loop_var: notification_channel}
tags: notification_channel

- name: Manage contact point
community.grafana.grafana_contact_point:
email_addresses: "{{ contact_point.email_addresses | default(omit) }}"
email_single: "{{ contact_point.email_single | default(omit) }}"
is_default: "{{ contact_point.is_default | default(omit) }}"
name: "{{ contact_point.name }}"
org_id: "{{ contact_point.org_id | default(omit) }}"
org_name: "{{ contact_point.org_id | default(omit) }}"
state: "{{ contact_point.state | default(omit) }}"
type: "{{ contact_point.type }}"
uid: "{{ contact_point.uid | default(omit) }}"
loop: "{{ grafana_contact_points }}"
loop_control: {loop_var: contact_point}
tags: contact_point

- name: Manage datasource
community.grafana.grafana_datasource:
access: "{{ datasource.access | default(omit) }}"
Expand Down

0 comments on commit 0dbf2d6

Please sign in to comment.