From 53e95072e269d168b6fc648c91c78d853f79074e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 22 Nov 2017 16:12:29 +0100 Subject: [PATCH] TT#24221 Check that grafana has the databases configured Change-Id: Ia7fd46adde8e9396da2af7c449cd6b3062bdcd86 (cherry picked from commit 7a6100c122d1cd5f07e73e69c57a56596f1e650a) --- templates/911_service-grafana.yaml.tt2 | 24 ++++++++++++++++++++++++ templates/goss.yaml.tt2 | 1 + 2 files changed, 25 insertions(+) create mode 100644 templates/911_service-grafana.yaml.tt2 diff --git a/templates/911_service-grafana.yaml.tt2 b/templates/911_service-grafana.yaml.tt2 new file mode 100644 index 0000000..aa8cdfd --- /dev/null +++ b/templates/911_service-grafana.yaml.tt2 @@ -0,0 +1,24 @@ +[% + PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; + hostname = out; + + argv.role = 'mgmt'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_mgmt = out; + + argv.role = 'li'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_li = out; + is_li_enabled = is_li && cluster_sets.type == 'distributed' && intercept.enabled == 'yes'; +-%] + +command: + +[% IF grafana.enabled == 'yes' && (is_mgmt || is_li_enabled) -%] + sqlite3 /var/lib/grafana/grafana.db "select name from data_source": + exit-status: 0 + stdout: + - "/^ngcp$/" + - "/^telegraf$/" + stderr: [] +[% END -%] diff --git a/templates/goss.yaml.tt2 b/templates/goss.yaml.tt2 index a653f20..c9bf8ca 100644 --- a/templates/goss.yaml.tt2 +++ b/templates/goss.yaml.tt2 @@ -36,3 +36,4 @@ gossfile: [% END -%] 900_service-ngcp-api.yaml: {} 910_service-influxdb.yaml: {} + 911_service-grafana.yaml: {}