]> git.ekhem.eu.org Git - turnup.git/commitdiff
Source environment variables before configuring services.
authorJakub Czajka <jakub@ekhem.eu.org>
Mon, 4 Dec 2023 01:55:32 +0000 (02:55 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
install/environment.yaml [new file with mode: 0644]
turnup.yaml

diff --git a/install/environment.yaml b/install/environment.yaml
new file mode 100644 (file)
index 0000000..db6deec
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- name: Create facts.d directory
+  file:
+    path: /etc/ansible/facts.d
+    state: directory
+  become: true
+- name: Checkout environment to /etc
+  command: /usr/bin/git --work-tree=/etc/ --git-dir=/srv/git/config.git checkout \
+    main --force environment
+  become: true
+- name: Export environment as ansible facts in the .ini format
+  shell: /usr/bin/sed 's/export\s//g ; s/\"//g ; 1s/^.*$/[vars]/' \
+    /etc/environment > /etc/ansible/facts.d/env.fact
+  become: true
index 12fae9c7d017480b6505cdbefe97987cab8b87bb..5b0dd6ef0d40fa32ee28975594814d591a56f690 100644 (file)
@@ -22,6 +22,7 @@
       with_items: "{{ inputs }}"
     - include_tasks: install/certify.yaml
       with_items: "{{ certificates }}"
+    - include_tasks: install/environment.yaml
     - find:
         paths: "/srv/git"
         file_type: file