ansible.builtin.grafana_dashboard (v2.9.27) — lookup

list or search grafana dashboards

| "added in version" 2.7 of ansible.builtin"

Authors: Thierry Salle (@seuf)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get all grafana dashboards
  set_fact:
    grafana_dashboards: "{{ lookup('grafana_dashboard', 'grafana_url=http://grafana.company.com grafana_api_key=' ~ grafana_api_key|replace('==', '')) }}"

Inputs

    
search:
    description: optional filter for dashboard search.
    env:
    - name: GRAFANA_DASHBOARD_SEARCH

grafana_url:
    default: http://127.0.0.1:3000
    description: url of grafana.
    env:
    - name: GRAFANA_URL

grafana_user:
    default: admin
    description: grafana authentication user.
    env:
    - name: GRAFANA_USER

grafana_org_id:
    default: 1
    description: grafana organisation id.
    env:
    - name: GRAFANA_ORG_ID

grafana_api_key:
    description:
    - api key of grafana.
    - when C(grafana_api_key) is set, the options C(grafan_user), C(grafana_password)
      and C(grafana_org_id) are ignored.
    - Attention, please remove the two == at the end of the grafana_api_key
    - because ansible lookup plugins options are split on = (see example).
    env:
    - name: GRAFANA_API_KEY

grafana_password:
    default: admin
    description: grafana authentication password.
    env:
    - name: GRAFANA_PASSWORD