From d81590c8a10275b72af0e97edb6d11940b473024 Mon Sep 17 00:00:00 2001 From: Alexandre Pires Date: Fri, 25 Apr 2025 21:26:51 +0200 Subject: [PATCH] Update workflow for OpenTofu Scaleway IAC application with Ansible setup and host info retrieval --- .../terraform-scaleway-iac-apply.yml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform-scaleway-iac-apply.yml b/.github/workflows/terraform-scaleway-iac-apply.yml index 7478825..2413a5d 100644 --- a/.github/workflows/terraform-scaleway-iac-apply.yml +++ b/.github/workflows/terraform-scaleway-iac-apply.yml @@ -1,4 +1,4 @@ -name: Terraform Scaleway IAC Apply +name: OpenTofu Scaleway IAC Apply on: schedule: @@ -21,6 +21,25 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-env + - name: Setup Ansible environment + uses: ./.github/actions/setup-ansible-env + with: + project-id: ${{ secrets.BW_PROJECT_ID }} + organization-id: ${{ secrets.BW_ORGANIZATION_ID }} + access-token: ${{ secrets.BW_ACCESS_TOKEN }} + ansible-user: ${{ secrets.ANSIBLE_USER }} + host-group: iac + + - name: Get Host Info + uses: ./.github/actions/get-host-info + id: get-host-info + with: + project-id: ${{ secrets.BW_PROJECT_ID }} + organization-id: ${{ secrets.BW_ORGANIZATION_ID }} + access-token: ${{ secrets.BW_ACCESS_TOKEN }} + ansible-user: ${{ secrets.ANSIBLE_USER }} + target-host: iac + - name: Setup OpenTofu environment uses: ./.github/actions/setup-opentofu-env @@ -29,7 +48,9 @@ jobs: BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }} BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }} BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }} + SYSTEM_ID: ${{ steps.get-host-info.outputs.system-id }} run: | cd terraform/scaleway-iac + export TF_VAR_system_id=$SYSTEM_ID sectool -f ../../sectool.json exec tofu init sectool -f ../../sectool.json exec tofu apply --auto-approve