From 366157e21264e0f131cd3b4ccf76539f94eaaf11 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sun, 3 Dec 2023 13:57:53 +0100 Subject: [PATCH] [config] Expand variables before creating the fact file. Ansible does not expand variables. --- config.git/deploy.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.git/deploy.yaml b/config.git/deploy.yaml index 83df766..d7f233c 100644 --- a/config.git/deploy.yaml +++ b/config.git/deploy.yaml @@ -15,6 +15,8 @@ state: directory become: true - name: Export environment as ansible facts in the .ini format - shell: sed --expression 's/export\s//g ; s/\"//g ; 1s/^.*$/[vars]/' \ - /etc/environment > /etc/ansible/facts.d/env.fact + shell: envsubst < /etc/environment \ + | sed 's/export\s//g ; s/\"//g ; 1s/^.*$/[vars]/' \ + > /etc/ansible/facts.d/env.fact + environment: "{{ ansible_local.env.vars }}" become: true -- 2.39.5