From e3870aa5c199a91413482d062a76eaff6a61c76e Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Tue, 30 Jul 2024 10:37:54 +0100 Subject: [PATCH] add grafana_plugins_ops to defaults and docs --- roles/grafana/README.md | 1 + roles/grafana/defaults/main.yml | 7 ++++++- roles/grafana/templates/grafana.ini.j2 | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/grafana/README.md b/roles/grafana/README.md index 4b49f6a4..c4a37311 100644 --- a/roles/grafana/README.md +++ b/roles/grafana/README.md @@ -64,6 +64,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `grafana_datasources` | [] | List of datasources which should be configured | | `grafana_environment` | {} | Optional Environment param for Grafana installation, useful ie for setting http_proxy | | `grafana_plugins` | [] | List of Grafana plugins which should be installed | +| `grafana_plugins_ops` | {} | [plugins](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#plugins-1) configuration section | | `grafana_alert_notifications` | [] | List of alert notification channels to be created, updated, or deleted | Data source example: diff --git a/roles/grafana/defaults/main.yml b/roles/grafana/defaults/main.yml index 958fc4c0..7fadbd7b 100644 --- a/roles/grafana/defaults/main.yml +++ b/roles/grafana/defaults/main.yml @@ -239,10 +239,15 @@ grafana_feature_toggles: {} # regressionTransformation: true ####### -# Plugins from https://grafana.com/plugins +# Plugins to install from https://grafana.com/plugins grafana_plugins: [] # - raintank-worldping-app +####### +# Configuration of plugins ([plugin] section of grafana.ini] +grafana_plugins_ops: {} +# allow_loading_unsigned_plugins: alexanderzobnin-zabbix-datasource + # Dashboards from https://grafana.com/dashboards grafana_dashboards: [] # - dashboard_id: '4271' diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2 index 0abcbdf3..91d31f21 100644 --- a/roles/grafana/templates/grafana.ini.j2 +++ b/roles/grafana/templates/grafana.ini.j2 @@ -38,7 +38,7 @@ root_url = {{ grafana_url }} {% endfor %} # Plugins -{% if grafana_plugins_ops is defined %} +{% if grafana_plugins_ops != {} %} [plugins] {% for k,v in grafana_plugins_ops.items() %} {{ k }} = {{ v }}