Spec-Zone.ru › Ansible

community.grafana.grafana_dashboard lookup – list or search grafana dashboards

Note

This lookup plugin is part of the community.grafana collection (version 2.3.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_dashboard.

  • Synopsis
  • Keyword parameters
  • Examples

Synopsis

  • This lookup returns a list of grafana dashboards with possibility to filter them by query.

Keyword parameters

This describes keyword parameters of the lookup. These are the values key1=value1, key2=value2 and so on in the following examples: lookup('community.grafana.grafana_dashboard', key1=value1, key2=value2, ...) and query('community.grafana.grafana_dashboard', key1=value1, key2=value2, ...)

Parameter

Comments

ca_path

string

string of the file system path to CA cert bundle to use for validation

grafana_api_key

string

Grafana API key.

When grafana_api_key is set, the options grafana_user, grafana_password and grafana_org_id are ignored.

Configuration:

  • Environment variable: GRAFANA_API_KEY

grafana_org_id

string

grafana organisation id.

Default: 1

Configuration:

  • Environment variable: GRAFANA_ORG_ID

grafana_password

string

grafana authentication password.

Default: "admin"

Configuration:

  • Environment variable: GRAFANA_PASSWORD

grafana_url

string

url of grafana.

Default: "http://127.0.0.1:3000"

Configuration:

  • Environment variable: GRAFANA_URL

grafana_user

string

grafana authentication user.

Default: "admin"

Configuration:

  • Environment variable: GRAFANA_USER

search

string

optional filter for dashboard search.

Configuration:

  • Environment variable: GRAFANA_DASHBOARD_SEARCH

validate_certs

boolean

flag to control SSL certificate validation

Choices:

  • false
  • true ← (default)

Examples

- name: get project foo grafana dashboards
  set_fact:
    grafana_dashboards: "{{ lookup('grafana_dashboard', 'grafana_url=http://grafana.company.com grafana_user=admin grafana_password=admin search=foo') }}"

- name: get all grafana dashboards
  set_fact:
    grafana_dashboards: "{{ lookup('grafana_dashboard', 'grafana_url=http://grafana.company.com grafana_api_key=' ~ grafana_api_key) }}"

- name: get project foo grafana dashboards (validate SSL certificates of the instance with custom CA Certificate Bundle)
  set_fact:
    grafana_dashboards: |
        {{
            lookup(
              'grafana_dashboard',
              'grafana_url=https://grafana.company.com grafana_user=admin grafana_password=admin search=foo',
              validate_certs=true,
              ca_path='/path/to/chain.crt'
            )
        }}

Authors

  • Thierry Salle (@seuf)

Collection links

  • Issue Tracker
  • Homepage
  • Repository (Sources)

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/community/grafana/grafana_dashboard_lookup.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API