From bd4c0d70ae74b8645c55443f89eea53a07a5332f Mon Sep 17 00:00:00 2001 From: Okesanya Odunayo <94924061+DrInTech22@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:58:23 +0100 Subject: [PATCH 1/2] modify compose file and apply.yml --- .github/workflows/terraform-apply.yml | 4 +++- ansible/compose.yml.j2 | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-apply.yml b/.github/workflows/terraform-apply.yml index ce2fa08..96f65f1 100644 --- a/.github/workflows/terraform-apply.yml +++ b/.github/workflows/terraform-apply.yml @@ -27,7 +27,8 @@ env: TF_VAR_db_domain: ${{ vars.TF_DB_DOMAIN }} TF_VAR_traefik_domain: ${{ vars.TF_TRAEFIK_DOMAIN }} TF_VAR_cert_email: ${{ secrets.TF_CERT_EMAIL }} - TF_VAR_private_key_path: ./${{ vars.TF_KEY_PAIR_NAME }}.pem + TF_VAR_private_key_path: ${{ vars.TF_KEY_PAIR_NAME }}.pem + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} jobs: build-infra: @@ -41,6 +42,7 @@ jobs: run: | echo "${{ secrets.PRIVATE_KEY }}" > ${{ vars.TF_KEY_PAIR_NAME }}.pem chmod 600 ${{ vars.TF_KEY_PAIR_NAME }}.pem + working-directory: ./terraform - name: Set up Terraform uses: hashicorp/setup-terraform@v2 diff --git a/ansible/compose.yml.j2 b/ansible/compose.yml.j2 index f717f70..17399f3 100644 --- a/ansible/compose.yml.j2 +++ b/ansible/compose.yml.j2 @@ -139,6 +139,6 @@ networks: volumes: postgres_data: secrets: - postgres_password: - file: ./POSTGRES_PASSWORD.txt + postgres_password: + environment: "POSTGRES_PASSWORD" From 978401f7df6a167384b993111c011fccc16bca6d Mon Sep 17 00:00:00 2001 From: Okesanya Odunayo <94924061+DrInTech22@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:19:50 +0100 Subject: [PATCH 2/2] modiy workflow_dispatch in apply.yml --- .github/workflows/terraform-apply.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform-apply.yml b/.github/workflows/terraform-apply.yml index 96f65f1..d457f0b 100644 --- a/.github/workflows/terraform-apply.yml +++ b/.github/workflows/terraform-apply.yml @@ -5,9 +5,13 @@ on: workflow_dispatch: inputs: operation: - description: 'Choose the Terraform operation (apply or destroy)' + description: 'Choose the Terraform operation' required: true default: 'apply' + type: choice + options: + - apply + - destroy push: branches: - 'infra_main'