From 84bc6cce9739e2f6e2bdbb3c970ebea8de16c1c1 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Fri, 8 Mar 2024 16:35:34 +0100 Subject: [PATCH] Improve inventory cleanup on the first time setup workflow (#40) --- .github/workflows/first-time-setup.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/first-time-setup.yml b/.github/workflows/first-time-setup.yml index 90e2160..d24b39c 100644 --- a/.github/workflows/first-time-setup.yml +++ b/.github/workflows/first-time-setup.yml @@ -44,12 +44,20 @@ jobs: - name: Update dependabot run: | sed -i "s|"OpenTermsArchive/demo"|"$REPOSITORY_OWNER/$REPOSITORY_NAME"|g" .github/dependabot.yml - - - name: Update deployment inventory + + - name: Cleanup deployment inventory run: | - sed -i -z -e "s|hosts:\n\([[:blank:]]*\).*:\n|hosts:\n\1$PLACEHOLDER:\n|g" deployment/inventory.yml && - sed -i "s|ansible_user: .*|ansible_user: $PLACEHOLDER|g" deployment/inventory.yml && - sed -i "s|ed25519_fingerprint: .*|ed25519_fingerprint: $PLACEHOLDER|g" deployment/inventory.yml + content="all: + hosts: + $PLACEHOLDER: + ansible_user: $PLACEHOLDER + ed25519_fingerprint: $PLACEHOLDER + ota_engine_declarations_branch: $PLACEHOLDER + ota_engine_github_bot_private_key: $PLACEHOLDER + ota_engine_github_token: $PLACEHOLDER + ota_engine_smtp_password: $PLACEHOLDER" + + echo "$content" > deployment/inventory.yml - name: Update config run: |