community.grafana.grafana_organization module – Manage Grafana Organization

Note

This module is part of the community.grafana collection (version 1.5.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 community.grafana.

To use it in a playbook, specify: community.grafana.grafana_organization.

New in version 1.3.0: of community.grafana

Synopsis

  • Create/delete Grafana organization through org API.

  • Tested with Grafana v6.5.0

Parameters

Parameter

Comments

client_cert

path

PEM formatted certificate chain file to be used for SSL client authentication.

This file can also include the key as well, and if the key is included, client_key is not required

client_key

path

PEM formatted file that contains your private key to be used for SSL client authentication.

If client_cert contains both the certificate and key, this option is not required.

name

string / required

The name of the Grafana Organization.

state

string

State if the organization should be present in Grafana or not

Choices:

  • present ← (default)

  • absent

url

aliases: grafana_url

string / required

The Grafana URL.

url_password

aliases: grafana_password

string

The Grafana password for API authentication.

Default: “admin”

url_username

aliases: grafana_user

string

The Grafana user for API authentication.

Default: “admin”

use_proxy

boolean

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • no

  • yes ← (default)

validate_certs

boolean

If no, SSL certificates will not be validated.

This should only set to no used on personally controlled sites using self-signed certificates.

Choices:

  • no

  • yes ← (default)

Examples

---
- name: Create a Grafana organization
  community.grafana.grafana_organization:
    url: "https://grafana.example.com"
    url_username: admin
    url_password: changeme
    name: orgtest
    state: present

- name: Delete a Grafana organization
  community.grafana.grafana_organization:
    url: "https://grafana.example.com"
    url_username: admin
    url_password: changeme
    name: orgtest
    state: absent

Return Values

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

Key

Description

org

complex

Information about the organization

Returned: when state present

address

dictionary

The org address

Returned: always

Sample: {“address1”: “”, “address2”: “”, “city”: “”, “country”: “”, “state”: “”, “zipCode”: “”}

id

integer

The org id

Returned: always

Sample: [42]

name

string

The org name

Returned: always

Sample: [“org42”]

Authors

  • paytroff (@paytroff)