feat: install unofficial plugins

This commit is contained in:
Adrien Waksberg 2021-08-21 23:21:52 +02:00
parent c11d156391
commit c854d12c4e
3 changed files with 25 additions and 3 deletions

View file

@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## Unreleased
### Added
- feat: install unofficial plugins
### Changed
- chore: use FQCN for module name

View file

@ -29,6 +29,8 @@ Install and configure Grafana
- name: grafana-piechart-panel
version: 1.3.6
state: present
- name: sensu-sensugo-datasource
url: https://github.com/sensu/grafana-sensu-go-datasource/releases/download/1.0.2/sensu-sensugo-datasource-1.0.2.zip
```
## How to use

View file

@ -3,6 +3,8 @@
ansible.builtin.package:
name:
- apt-transport-https
- gpg
- unzip
retries: 2
register: result
until: result is succeeded
@ -50,12 +52,26 @@
notify: restart grafana
tags: grafana
- name: install plugins
grafana_plugin:
- name: install official plugins
community.grafana.grafana_plugin:
name: '{{ item.name }}'
version: '{{ item.version|default("latest") }}'
state: '{{ item.state|default("present") }}'
loop: '{{ grafana_plugins }}'
loop: '{{ grafana_plugins|selectattr("url", "undefined") }}'
loop_control:
label: '{{ item.name }}'
notify: restart grafana
tags: grafana
- name: install unofficial plugins
community.grafana.grafana_plugin:
name: '{{ item.name }}'
grafana_plugin_url: '{{ item.url }}'
version: '{{ item.version|default("latest") }}'
state: '{{ item.state|default("present") }}'
loop: '{{ grafana_plugins|selectattr("url", "defined") }}'
loop_control:
label: '{{ item.name }}'
notify: restart grafana
tags: grafana