From: John Karasev Date: Tue, 27 Apr 2021 20:52:48 +0000 (-0700) Subject: ceph-grafana: Add proxy env vars to grafana service template X-Git-Tag: v5.0.12~19 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2e2d23c79e04420f04d58487f9f73fc08431bc05;p=ceph-ansible.git 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 (cherry picked from commit 79ca442d53ba25a463fc5bbb9a863da22cec55d1) --- 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`"