Skip to content

Directly pass dashboard content #417

@Hipska

Description

@Hipska
SUMMARY

Having the option to directly pass the dashboard content would eliminate the need to first create a file on the local filesystem.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

community.grafana.grafana_dashboard

ADDITIONAL INFORMATION

The dashboard definition could come from a ansible var (object or JSON string) or directly passed to the task.

- name: Import Grafana dashboard foo from ansible var object
  community.grafana.grafana_dashboard:
    grafana_url: http://grafana.company.com
    grafana_api_key: "{{ grafana_api_key }}"
    state: present
    content: "{{ foo_dashboard }}"

- name: Import Grafana dashboard foo from json string
  community.grafana.grafana_dashboard:
    grafana_url: http://grafana.company.com
    grafana_api_key: "{{ grafana_api_key }}"
    state: present
    content: >
      {
        "title": "Foo",
        "style": "dark",
        ...
      }

# looks useless, but needs to be supported if the ansible var could be type object instead of JSON string
- name: Import Grafana dashboard foo from yaml
  community.grafana.grafana_dashboard:
    grafana_url: http://grafana.company.com
    grafana_api_key: "{{ grafana_api_key }}"
    state: present
    content:
      title: Foo
      style: dark
      ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions