shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

[grafana] Playbook to Import / Export Dashboards #119

Open shantanoo-desai opened 10 months ago

shantanoo-desai commented 10 months ago

Description

Provide playbook(s) to import / export Grafana Dashboards. Conduct checks on datasource compatibility. Use the ansible.community.grafana Galaxy Collection for the playbook modules.

Tasks

shantanoo-desai commented 10 months ago

Update

shantanoo-desai commented 10 months ago

Draft Playbook

---
- name: Playbook to Manage Grafana Dashboards
  hosts: localhost
  gather_facts: true
  vars_files:
    - vars/creds.yml
  collections:
    - community.grafana

  tasks:
    - name: Export Grafana Dashboard
      community.grafana.grafana_dashboard:
        grafana_url: "http://localhost/grafana"
        grafana_user: "{{ credentials.grafana.admin_username }}@localhost"
        grafana_password: "{{ credentials.grafana.admin_password }}"
        validate_certs: false
        path: "./dashboard_test.json"
        overwrite: yes
        state: present
        use_proxy: false