From 6ada89c662dae4611d0c4f09d09151bfcab4b3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Dom=C3=ADnguez?= <43052541+kysrpex@users.noreply.github.com> Date: Thu, 2 Nov 2023 11:03:20 +0100 Subject: [PATCH] Workaround Ansible vault password not being available to GitHub. Works around Ansible being unable to decrypt vault files for the HTCondor cluster. --- .github/workflows/tpv.py | 4 +++- .github/workflows/tpv.yml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tpv.py b/.github/workflows/tpv.py index 0df7810a2..cf4927b5b 100755 --- a/.github/workflows/tpv.py +++ b/.github/workflows/tpv.py @@ -132,7 +132,9 @@ def make_playbook( dummy_vars = {} # - determinate what is already defined in group variables group_vars = set() - for file_path in glob.glob(str(directory / "group_vars" / "*")): + for file_path in glob.glob( + str(directory / "group_vars" / "**" / "*.y*ml"), recursive=True + ): contents = yaml.safe_load(open(file_path)) group_vars |= set(contents) # - for vars files diff --git a/.github/workflows/tpv.yml b/.github/workflows/tpv.yml index f74dc863d..5b2b91f7d 100644 --- a/.github/workflows/tpv.yml +++ b/.github/workflows/tpv.yml @@ -22,6 +22,12 @@ jobs: with: path: 'infrastructure-playbook' + - name: Workaround Ansible vault password not being available to GitHub. + working-directory: 'infrastructure-playbook' + run: | + rm -f group_vars/htcondor/vault.yml + rm -f group_vars/htcondor-secondary/vault.yml + - name: Update git submodules. working-directory: 'infrastructure-playbook' run: | @@ -181,6 +187,12 @@ jobs: fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} path: 'infrastructure-playbook' + - name: Workaround Ansible vault password not being available to GitHub. + working-directory: 'infrastructure-playbook' + run: | + rm -f group_vars/htcondor/vault.yml + rm -f group_vars/htcondor-secondary/vault.yml + - name: Update git submodules. working-directory: 'infrastructure-playbook' run: |