diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d268597..4b7deae 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - tf: [1.0.7] + tf: [1.4] vsphere: #- vmware_os: vmware_esxi_6_7 # vcenter_iso: VMware-VCSA-all-6.7.0-14367737.iso @@ -34,40 +34,41 @@ jobs: TF_VAR_esxi_host_count: 2 TF_VAR_esxi_size: "c3.medium.x86" TF_VAR_router_size: "c3.medium.x86" - TF_VAR_facility: "dc13" + TF_VAR_metro: "dc" TF_VAR_create_project : false - # TODO only provide this to terraform steps that need it - TF_VAR_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} - TF_VAR_s3_url: ${{ secrets.S3_URL }} - TF_VAR_object_store_bucket_name: ${{ secrets.S3_BUCKET_NAME }} - TF_VAR_s3_access_key: ${{ secrets.S3_ACCESS_KEY }} - TF_VAR_s3_secret_key: ${{ secrets.S3_SECRET_KEY }} steps: - name: Checkout from Github - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Add SHORT_SHA env property with commit short sha run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Install Terraform - uses: hashicorp/setup-terraform@v1 + uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ env.TF_VERSION }} - name: Initialize Terraform, Modules, and Plugins id: init run: terraform init -input=false - id: project - uses: displague/metal-project-action@v0.10.0 - env: - METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }} + uses: equinix-labs/metal-project-action@v0.14.1 + with: + userToken: ${{ secrets.METAL_AUTH_TOKEN }} # Configure an SSH Agent with a key that can access the project - name: SSH Agent run: | ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add <(echo $METAL_SSH_PRIVATE_KEY_BASE64 | base64 -d) + ssh-add <(echo ${{ steps.project.outputs.projectSSHPrivateKeyBase64 }} | base64 -d) - name: Terraform Vars - Cluster Name run: echo "TF_VAR_vcenter_cluster_name=tfacc-${SHORT_SHA}" >> $GITHUB_ENV - name: Terraform Vars - Project ID - run: echo "TF_VAR_project_id=${{ steps.project.outputs.projectID }}" >> $GITHUB_ENV + run: | + echo "TF_VAR_project_id=${{ steps.project.outputs.projectID }}" >> $GITHUB_ENV + echo "METAL_AUTH_TOKEN=${{ steps.project.outputs.projectToken }}" >> $GITHUB_ENV # used by Equinix provider when auth_token not specified + echo "TF_VAR_auth_token=${{ steps.project.outputs.projectToken }}" >> $GITHUB_ENV + echo "TF_VAR_s3_url=${{ secrets.S3_URL }}" >> $GITHUB_ENV + echo "TF_VAR_object_store_bucket_name=${{ secrets.S3_BUCKET_NAME }}" >> $GITHUB_ENV + echo "TF_VAR_s3_access_key=${{ secrets.S3_ACCESS_KEY }}" >> $GITHUB_ENV + echo "TF_VAR_s3_secret_key=${{ secrets.S3_SECRET_KEY }}" >> $GITHUB_ENV - name: Terraform Plan id: plan timeout-minutes: 120 @@ -82,7 +83,7 @@ jobs: run: terraform destroy -input=false -auto-approve - name: Project Delete if: ${{ always() }} - uses: displague/metal-sweeper-action@v0.3.0 - env: - METAL_PROJECT_ID: ${{ steps.project.outputs.projectID }} - METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }} + uses: equinix-labs/metal-sweeper-action@v0.6.1 + with: + authToken: ${{ secrets.METAL_AUTH_TOKEN }} + projectID: ${{ steps.project.outputs.projectID }} diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 64fc216..f664f29 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - tf: [0.14.8] + tf: [1.4] steps: - name: Checkout from Github uses: actions/checkout@v2 diff --git a/versions.tf b/versions.tf index e1e723a..fdf9b46 100644 --- a/versions.tf +++ b/versions.tf @@ -1,5 +1,5 @@ terraform { - experiments = [module_variable_optional_attrs] + required_version = "~> 1.4" required_providers { null = { source = "hashicorp/null"