Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grafana] Playbook to Import / Export Dashboards #119

Open
2 tasks
shantanoo-desai opened this issue Oct 4, 2023 · 2 comments
Open
2 tasks

[grafana] Playbook to Import / Export Dashboards #119

shantanoo-desai opened this issue Oct 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request grafana All activities related to Grafana Monitoring

Comments

@shantanoo-desai
Copy link
Owner

shantanoo-desai commented Oct 4, 2023

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

  • Import a Dashboard JSON file into the Grafana instance
  • Export an existing Dashboard JSON file from the Grafana instance
@shantanoo-desai shantanoo-desai added enhancement New feature or request grafana All activities related to Grafana Monitoring labels Oct 4, 2023
@shantanoo-desai shantanoo-desai self-assigned this Oct 4, 2023
@shantanoo-desai
Copy link
Owner Author

shantanoo-desai commented Oct 17, 2023

Update

  • Importing the Grafana Dashboard JSON via the User-Interface has better User-Experience than via the ansible.community.grafana collection

  • ansible.community.grafana import / export features rely on dashboards file to exist on the controlled nodes NOT on the controller node.

@shantanoo-desai
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request grafana All activities related to Grafana Monitoring
Projects
Status: No status
Development

No branches or pull requests

1 participant