grafana.grafana.cloud_plugin module – Manage Grafana Cloud Plugins

Note

This module is part of the grafana.grafana collection (version 5.6.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install grafana.grafana. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: grafana.grafana.cloud_plugin.

New in grafana.grafana 0.0.1

Synopsis

  • Create, Update and delete Grafana Cloud plugins using Ansible.

Requirements

The below requirements are needed on the host that executes this module.

  • requests >= 1.0.0

Parameters

Parameter

Comments

cloud_api_key

string / required

Cloud API Key to authenticate with Grafana Cloud.

name

string / required

Name of the plugin, e.g. grafana-github-datasource.

stack_slug

string / required

Name of the Grafana Cloud stack to which the plugin will be added.

state

string

State for the Grafana Cloud Plugin.

Choices:

  • "present" ← (default)

  • "absent"

version

string

Version of the plugin to install.

Default: "latest"

Notes

Note

  • Does not support check_mode.

Examples

- name: Create/Update a plugin
  grafana.grafana.cloud_plugin:
    name: grafana-github-datasource
    version: 1.0.14
    stack_slug: "{{ stack_slug }}"
    cloud_api_key: "{{ grafana_cloud_api_key }}"
    state: present

- name: Delete a Grafana Cloud stack
  grafana.grafana.cloud_plugin:
    name: grafana-github-datasource
    stack_slug: "{{ stack_slug }}"
    cloud_api_key: "{{ grafana_cloud_api_key }}"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

current_version

string

Current version of the plugin.

Returned: On success

Sample: "1.0.14"

latest_version

string

Latest version available for the plugin.

Returned: On success

Sample: "1.0.15"

pluginId

integer

Id for the Plugin.

Returned: On success

Sample: 663

pluginName

string

Name of the plugin.

Returned: On success

Sample: "GitHub"

pluginSlug

string

Slug for the Plugin.

Returned: On success

Sample: "grafana-github-datasource"

Authors

  • Ishan Jain (@ishanjainn)