Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main' into empovit-prs
Browse files Browse the repository at this point in the history
  • Loading branch information
displague committed Jun 3, 2024
2 parents 245e04f + f386556 commit a89ce98
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 162 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
strategy:
matrix:
python-version:
- 3.6.7 # Match the version on the gateway node
- 3.12 # Match the version on the gateway node

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- id: fmt_and_lint
run: |
pip install black==21.4b2 pylama
pip install black pylama
black --check --diff .
pylama
39 changes: 20 additions & 19 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
137 changes: 0 additions & 137 deletions .terraform.lock.hcl

This file was deleted.

2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ resource "null_resource" "reboot_post_upgrade" {
command = "sleep 250"
}
}

resource "equinix_metal_port" "esxi_hosts" {
count = length(equinix_metal_device.esxi_hosts)
bonded = false
Expand Down Expand Up @@ -420,6 +421,7 @@ resource "null_resource" "apply_esx_network_config" {
count = length(equinix_metal_device.esxi_hosts)
depends_on = [
null_resource.reboot_post_upgrade,
equinix_metal_port.esxi_hosts,
null_resource.esx_network_prereqs,
null_resource.copy_update_uplinks,
null_resource.install_vpn_server
Expand Down
4 changes: 3 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
terraform {
required_version = "~> 1.4"

required_providers {
null = {
source = "hashicorp/null"
Expand All @@ -20,7 +22,7 @@ terraform {
source = "hashicorp/local"
}
}
required_version = ">= 1.3.0"

provider_meta "equinix" {
module_name = "equinix-metal-vsphere"
}
Expand Down

0 comments on commit a89ce98

Please sign in to comment.