From 79ca442d53ba25a463fc5bbb9a863da22cec55d1 Mon Sep 17 00:00:00 2001 From: John Karasev Date: Tue, 27 Apr 2021 13:52:48 -0700 Subject: [PATCH] ceph-grafana: Add proxy env vars to grafana service template When installing grafana plugins, the container will make http requests. This requires http proxy otherwise installation cannot be performed. Passed the proxy vars from all.yml as env args. Fixes: ceph#6484, ceph#6481 Signed-off-by: John Karasev --- roles/ceph-grafana/templates/grafana-server.service.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/ceph-grafana/templates/grafana-server.service.j2 b/roles/ceph-grafana/templates/grafana-server.service.j2 index 27c8d8a79..f9548ec66 100644 --- a/roles/ceph-grafana/templates/grafana-server.service.j2 +++ b/roles/ceph-grafana/templates/grafana-server.service.j2 @@ -32,6 +32,15 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=grafana-server \ --memory={{ grafana_container_memory }}GB \ --memory-swap={{ grafana_container_memory * 2 }}GB \ -e GF_INSTALL_PLUGINS={{ grafana_plugins|join(',') }} \ +{% if ceph_docker_http_proxy is defined %} + -e http_proxy={{ ceph_docker_http_proxy }} \ +{% endif %} +{% if ceph_docker_https_proxy is defined %} + -e https_proxy={{ ceph_docker_https_proxy }} \ +{% endif %} +{% if ceph_docker_no_proxy is defined %} + -e no_proxy={{ ceph_docker_no_proxy }} \ +{% endif %} {{ grafana_container_image }} {% if container_binary == 'podman' %} ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"