From: Jakub Czajka Date: Sun, 3 Dec 2023 12:57:53 +0000 (+0100) Subject: [config] Expand variables before creating the fact file. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=366157e21264e0f131cd3b4ccf76539f94eaaf11;p=metadata.git [config] Expand variables before creating the fact file. Ansible does not expand variables. --- 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