ansible / ansible.builtin / v2.9.25 / lookup / grafana_dashboard list or search grafana dashboards | "added in version" 2.7 of ansible.builtin" Authors: Thierry Salle (@seuf) preview | supported by communityansible.builtin.grafana_dashboard (v2.9.25) — lookup
pip
Install with pip install ansible==2.9.25
This lookup returns a list of grafana dashboards with possibility to filter them by query.
- 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|replace('==', '')) }}"
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