From 7239986f1e96271a9684d177e49fe4c079643683 Mon Sep 17 00:00:00 2001 From: "Ntwali B." Date: Tue, 17 Sep 2024 08:22:15 +0100 Subject: [PATCH] [#267] Add environment variable that indicates whether Google analytics is enabled or not (#31) * [#267] Remove duplicate become key. * [#267] Add new environment variable that allows users to detect whether Google analytics is enabled or not. * [#267] Pedantry... * Integrate feedback from Craig Cooper: reduce nesting of ansible conditionals and pass the value of 'ckan_googleanalytics_enable' as the value of the environment variable CKAN_GOOGLEANALYTICS_ENABLED. * Enable or disable Google analytics when not running locally. --- roles/ckan/templates/kubernetes/ckan.yaml | 4 ++++ roles/minikube-setup/tasks/main.yml | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/ckan/templates/kubernetes/ckan.yaml b/roles/ckan/templates/kubernetes/ckan.yaml index 091e4c1..7e91733 100644 --- a/roles/ckan/templates/kubernetes/ckan.yaml +++ b/roles/ckan/templates/kubernetes/ckan.yaml @@ -86,6 +86,8 @@ spec: value: "/usr/lib/ckan/.minikubevenv" - name: XDG_CACHE_HOME value: "/usr/lib/ckan/.minikubevenv/cache" + - name: CKAN_GOOGLEANALYTICS_ENABLED + value: "{{ ckan_googleanalytics_enable }}" image: {{ ckan_image }}:{{ ckan_image_tag }} imagePullPolicy: IfNotPresent @@ -145,6 +147,8 @@ spec: value: "{{ ckan_postgres_password }}" - name: PIPENV_DONT_LOAD_ENV value: "1" + - name: CKAN_GOOGLEANALYTICS_ENABLED + value: "{{ ckan_googleanalytics_enable }}" {% if fjelltopp_cloud_provider != 'azure' %} - name: AWS_DEFAULT_REGION value: "{{ aws_region }}" diff --git a/roles/minikube-setup/tasks/main.yml b/roles/minikube-setup/tasks/main.yml index 20af2b4..80061e9 100644 --- a/roles/minikube-setup/tasks/main.yml +++ b/roles/minikube-setup/tasks/main.yml @@ -25,4 +25,3 @@ line: "{{ cluster_ip }} {{ app_fqdn }}" state: present backup: yes - become: true