From fff95583bda563ae4356900d888b07d491d454c6 Mon Sep 17 00:00:00 2001 From: Nemental <15136847+Nemental@users.noreply.github.com> Date: Tue, 28 May 2024 13:50:16 +0200 Subject: [PATCH] feat: role task arguments --- roles/grafana/README.md | 8 +-- roles/grafana/tasks/main.yml | 134 +++++++++++++++++++++++++++++++++-- 2 files changed, 131 insertions(+), 11 deletions(-) diff --git a/roles/grafana/README.md b/roles/grafana/README.md index 09901eff..a6ce7507 100644 --- a/roles/grafana/README.md +++ b/roles/grafana/README.md @@ -180,8 +180,8 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use | org_name | no | | provisioning | no | | state | no | -| type | yes | -| uid | no | +| type | no | +| uid | yes | | alertmanager_password | no | | alertmanager_url | no | | alertmanager_username | no | @@ -198,9 +198,9 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use | email_message | no | | email_single | no | | email_subject | no | -| googlechat_url | no | | googlechat_message | no | | googlechat_title | no | +| googlechat_url | no | | kafka_api_version | no | | kafka_cluster_id | no | | kafka_description | no | @@ -243,12 +243,12 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use | pushover_upload_image | no | | pushover_user_key | no | | sensugo_api_key | no | -| sensugo_url | no | | sensugo_check | no | | sensugo_entity | no | | sensugo_handler | no | | sensugo_message | no | | sensugo_namespace | no | +| sensugo_url | no | | slack_endpoint_url | no | | slack_icon_emoji | no | | slack_icon_url | no | diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 347ef1c6..170d9337 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -91,15 +91,135 @@ - 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 }}" + disable_resolve_message: "{{ contact_point.disable_resolve_message | default(omit) }}" + include_image: "{{ contact_point.include_image | default(omit) }}" + name: "{{ contact_point.name | default(omit) }}" org_id: "{{ contact_point.org_id | default(omit) }}" - org_name: "{{ contact_point.org_id | default(omit) }}" + org_name: "{{ contact_point.org_name | default(omit) }}" + provisioning: "{{ contact_point.provisioning | default(omit) }}" state: "{{ contact_point.state | default(omit) }}" - type: "{{ contact_point.type }}" - uid: "{{ contact_point.uid | default(omit) }}" + type: "{{ contact_point.type | default(omit) }}" + uid: "{{ contact_point.uid }}" + alertmanager_password: "{{ contact_point.alertmanager_password | default(omit) }}" + alertmanager_url: "{{ contact_point.alertmanager_url | default(omit) }}" + alertmanager_username: "{{ contact_point.alertmanager_username | default(omit) }}" + dingding_message: "{{ contact_point.dingding_message | default(omit) }}" + dingding_message_type: "{{ contact_point.dingding_message_type | default(omit) }}" + dingding_title: "{{ contact_point.dingding_title | default(omit) }}" + dingding_url: "{{ contact_point.dingding_url | default(omit) }}" + discord_avatar_url: "{{ contact_point.discord_avatar_url | default(omit) }}" + discord_message: "{{ contact_point.discord_message | default(omit) }}" + discord_title: "{{ contact_point.discord_title | default(omit) }}" + discord_url: "{{ contact_point.discord_url | default(omit) }}" + discord_use_username: "{{ contact_point.discord_use_username | default(omit) }}" + email_addresses: "{{ contact_point.email_addresses | default(omit) }}" + email_message: "{{ contact_point.email_message | default(omit) }}" + email_single: "{{ contact_point.email_single | default(omit) }}" + email_subject: "{{ contact_point.email_subject | default(omit) }}" + googlechat_message: "{{ contact_point.googlechat_message | default(omit) }}" + googlechat_title: "{{ contact_point.googlechat_title | default(omit) }}" + googlechat_url: "{{ contact_point.googlechat_url | default(omit) }}" + kafka_api_version: "{{ contact_point.kafka_api_version | default(omit) }}" + kafka_cluster_id: "{{ contact_point.kafka_cluster_id | default(omit) }}" + kafka_description: "{{ contact_point.kafka_description | default(omit) }}" + kafka_details: "{{ contact_point.kafka_details | default(omit) }}" + kafka_password: "{{ contact_point.kafka_password | default(omit) }}" + kafka_rest_proxy_url: "{{ contact_point.kafka_rest_proxy_url | default(omit) }}" + kafka_topic: "{{ contact_point.kafka_topic | default(omit) }}" + kafka_username: "{{ contact_point.kafka_username | default(omit) }}" + line_description: "{{ contact_point.line_description | default(omit) }}" + line_title: "{{ contact_point.line_title | default(omit) }}" + line_token: "{{ contact_point.line_token | default(omit) }}" + opsgenie_api_key: "{{ contact_point.opsgenie_api_key | default(omit) }}" + opsgenie_auto_close: "{{ contact_point.opsgenie_auto_close | default(omit) }}" + opsgenie_description: "{{ contact_point.opsgenie_description | default(omit) }}" + opsgenie_message: "{{ contact_point.opsgenie_message | default(omit) }}" + opsgenie_override_priority: "{{ contact_point.opsgenie_override_priority | default(omit) }}" + opsgenie_responders: "{{ contact_point.opsgenie_responders | default(omit) }}" + opsgenie_send_tags_as: "{{ contact_point.opsgenie_send_tags_as | default(omit) }}" + opsgenie_url: "{{ contact_point.opsgenie_url | default(omit) }}" + pagerduty_class: "{{ contact_point.pagerduty_class | default(omit) }}" + pagerduty_client: "{{ contact_point.pagerduty_client | default(omit) }}" + pagerduty_client_url: "{{ contact_point.pagerduty_client_url | default(omit) }}" + pagerduty_component: "{{ contact_point.pagerduty_component | default(omit) }}" + pagerduty_details: "{{ contact_point.pagerduty_details | default(omit) }}" + pagerduty_group: "{{ contact_point.pagerduty_group | default(omit) }}" + pagerduty_integration_key: "{{ contact_point.pagerduty_integration_key | default(omit) }}" + pagerduty_severity: "{{ contact_point.pagerduty_severity | default(omit) }}" + pagerduty_source: "{{ contact_point.pagerduty_source | default(omit) }}" + pagerduty_summary: "{{ contact_point.pagerduty_summary | default(omit) }}" + pushover_api_token: "{{ contact_point.pushover_api_token | default(omit) }}" + pushover_devices: "{{ contact_point.pushover_devices | default(omit) }}" + pushover_expire: "{{ contact_point.pushover_expire | default(omit) }}" + pushover_message: "{{ contact_point.pushover_message | default(omit) }}" + pushover_ok_priority: "{{ contact_point.pushover_ok_priority | default(omit) }}" + pushover_ok_sound: "{{ contact_point.pushover_ok_sound | default(omit) }}" + pushover_priority: "{{ contact_point.pushover_priority | default(omit) }}" + pushover_retry: "{{ contact_point.pushover_retry | default(omit) }}" + pushover_sound: "{{ contact_point.pushover_sound | default(omit) }}" + pushover_title: "{{ contact_point.pushover_title | default(omit) }}" + pushover_upload_image: "{{ contact_point.pushover_upload_image | default(omit) }}" + pushover_user_key: "{{ contact_point.pushover_user_key | default(omit) }}" + sensugo_api_key: "{{ contact_point.sensugo_api_key | default(omit) }}" + sensugo_check: "{{ contact_point.sensugo_check | default(omit) }}" + sensugo_entity: "{{ contact_point.sensugo_entity | default(omit) }}" + sensugo_handler: "{{ contact_point.sensugo_handler | default(omit) }}" + sensugo_message: "{{ contact_point.sensugo_message | default(omit) }}" + sensugo_namespace: "{{ contact_point.sensugo_namespace | default(omit) }}" + sensugo_url: "{{ contact_point.sensugo_url | default(omit) }}" + slack_endpoint_url: "{{ contact_point.slack_endpoint_url | default(omit) }}" + slack_icon_emoji: "{{ contact_point.slack_icon_emoji | default(omit) }}" + slack_icon_url: "{{ contact_point.slack_icon_url | default(omit) }}" + slack_mention_channel: "{{ contact_point.slack_mention_channel | default(omit) }}" + slack_mention_groups: "{{ contact_point.slack_mention_groups | default(omit) }}" + slack_mention_users: "{{ contact_point.slack_mention_users | default(omit) }}" + slack_recipient: "{{ contact_point.slack_recipient | default(omit) }}" + slack_text: "{{ contact_point.slack_text | default(omit) }}" + slack_title: "{{ contact_point.slack_title | default(omit) }}" + slack_token: "{{ contact_point.slack_token | default(omit) }}" + slack_url: "{{ contact_point.slack_url | default(omit) }}" + slack_username: "{{ contact_point.slack_username | default(omit) }}" + teams_message: "{{ contact_point.teams_message | default(omit) }}" + teams_section_title: "{{ contact_point.teams_section_title | default(omit) }}" + teams_title: "{{ contact_point.teams_title | default(omit) }}" + teams_url: "{{ contact_point.teams_url | default(omit) }}" + telegram_chat_id: "{{ contact_point.telegram_chat_id | default(omit) }}" + telegram_disable_notifications: "{{ contact_point.telegram_disable_notifications | default(omit) }}" + telegram_message: "{{ contact_point.telegram_message | default(omit) }}" + telegram_parse_mode: "{{ contact_point.telegram_parse_mode | default(omit) }}" + telegram_protect_content: "{{ contact_point.telegram_protect_content | default(omit) }}" + telegram_token: "{{ contact_point.telegram_token | default(omit) }}" + telegram_web_page_view: "{{ contact_point.telegram_web_page_view | default(omit) }}" + threema_api_secret: "{{ contact_point.threema_api_secret | default(omit) }}" + threema_description: "{{ contact_point.threema_description | default(omit) }}" + threema_gateway_id: "{{ contact_point.threema_gateway_id | default(omit) }}" + threema_recipient_id: "{{ contact_point.threema_recipient_id | default(omit) }}" + threema_title: "{{ contact_point.threema_title | default(omit) }}" + victorops_description: "{{ contact_point.victorops_description | default(omit) }}" + victorops_message_type: "{{ contact_point.victorops_message_type | default(omit) }}" + victorops_title: "{{ contact_point.victorops_title | default(omit) }}" + victorops_url: "{{ contact_point.victorops_url | default(omit) }}" + webex_api_url: "{{ contact_point.webex_api_url | default(omit) }}" + webex_message: "{{ contact_point.webex_message | default(omit) }}" + webex_room_id: "{{ contact_point.webex_room_id | default(omit) }}" + webex_token: "{{ contact_point.webex_token | default(omit) }}" + webhook_authorization_credentials: "{{ contact_point.webhook_authorization_credentials | default(omit) }}" + webhook_authorization_scheme: "{{ contact_point.webhook_authorization_scheme | default(omit) }}" + webhook_http_method: "{{ contact_point.webhook_http_method | default(omit) }}" + webhook_max_alerts: "{{ contact_point.webhook_max_alerts | default(omit) }}" + webhook_message: "{{ contact_point.webhook_message | default(omit) }}" + webhook_password: "{{ contact_point.webhook_password | default(omit) }}" + webhook_title: "{{ contact_point.webhook_title | default(omit) }}" + webhook_url: "{{ contact_point.webhook_url | default(omit) }}" + webhook_username: "{{ contact_point.webhook_username | default(omit) }}" + wecom_agent_id: "{{ contact_point.wecom_agent_id | default(omit) }}" + wecom_corp_id: "{{ contact_point.wecom_corp_id | default(omit) }}" + wecom_message: "{{ contact_point.wecom_message | default(omit) }}" + wecom_msg_type: "{{ contact_point.wecom_msg_type | default(omit) }}" + wecom_secret: "{{ contact_point.wecom_secret | default(omit) }}" + wecom_title: "{{ contact_point.wecom_title | default(omit) }}" + wecom_to_user: "{{ contact_point.wecom_to_user | default(omit) }}" + wecom_url: "{{ contact_point.wecom_url | default(omit) }}" loop: "{{ grafana_contact_points }}" loop_control: {loop_var: contact_point} tags: contact_point