From ae28499ab126e4ca97edd5155d90813cb1bdd01b Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:08:38 -0400 Subject: [PATCH 01/54] fix tf apply --- .forgejo/workflows/tofu.yml | 65 ++++++++++++++++++++++++------- docker/whisper/docker-compose.yml | 19 --------- 2 files changed, 51 insertions(+), 33 deletions(-) delete mode 100644 docker/whisper/docker-compose.yml diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index f9c974e..e0e89b2 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -1,4 +1,4 @@ -name: Terraform Apply +name: OpenTofu Automation on: push: @@ -6,27 +6,64 @@ on: - 'terraform/**' jobs: - terraform: + deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Download OpenTofu Installer + - name: Get Secrets from Bitwarden + id: bitwarden-secrets + uses: https://github.com/bitwarden/sm-action@v2 + with: + access_token: ${{ secrets.BW_ACCESS_TOKEN }} + base_url: https://vault.bitwarden.com + secrets: | + c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address + a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address + dacbeafa-c671-4b9c-9334-b2080006f75b > init_password + 9ceabbd0-6492-4674-9bab-b2080006e333 > init_username + 0bc3c1a3-fc48-48ce-85c5-b2080007136a > kasm_ip + 63ca1819-5090-4e30-9dba-b20800072718 > kasm_ssh_ip + 47ef68aa-32a9-45b0-835d-b2080006ce38 > npm_ip_address + d0c7f3ec-8277-4b1b-9a1b-b2080006b842 > prox_ip_address + 17ab7869-c7a1-4ece-8c64-b20800075213 > pve2_ip_address + f8f85ab2-5f6d-46a7-9e06-b20800076d26 > s3_endpoint + 68f1d77d-4e96-498a-9464-b208000679a4 > ssh_password + d0762ced-73de-4f30-aa1c-b20800069536 > ssh_username + d8017351-7a11-42e6-9e8d-b208000739b8 > ubu_ip_address + 1d250f4a-ae18-4e19-934c-b2080005e132 > virtual_environment_api + a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint + af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway + + - name: Write secrets to terraform.tfvars run: | - curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh - chmod +x install-opentofu.sh + SECRETS=("arrbuntu_ip_address" "downloaders_ip_address" "init_password" "kasm_ip" "kasm_ssh_ip" "npm_ip_address" "prox_ip_address" "pve2_ip_address" "s3_endpoint" "ssh_password" "ssh_username" "ubu_ip_address" "virtual_environment_api" "virtual_environment_endpoint" "vlan_gateway") + for secret in "${SECRETS[@]}"; do + echo "${secret} = \"${{ steps.bitwarden-secrets.outputs[secret] }}\"" >> ./terraform/terraform.tfvars + done - - name: Inspect and Install OpenTofu - run: ./install-opentofu.sh --install-method deb + - name: Configure AWS Credentials + uses: https://github.com/aws-actions/configure-aws-credentials@v2 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Clean up Installer Script - run: rm -f install-opentofu.sh + - name: Setup OpenTofu + uses: https://github.com/opentofu/setup-opentofu@v1 - - name: Initialize OpenTofu + - name: Run OpenTofu Init run: tofu init - working-directory: ./terraform - - name: Apply OpenTofu - run: tofu apply -input=false - working-directory: ./terraform + - name: Run OpenTofu Plan + id: plan + run: tofu plan -no-color + + - name: Display Plan Output + run: | + echo "Plan output:" + echo "${{ steps.plan.outputs.stdout }}" + + - name: Apply the Plan + if: success() + run: tofu apply -auto-approve diff --git a/docker/whisper/docker-compose.yml b/docker/whisper/docker-compose.yml deleted file mode 100644 index 32b4942..0000000 --- a/docker/whisper/docker-compose.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -version: "2.1" -services: - whisperasr: - container_name: whisper - image: onerahmet/openai-whisper-asr-webservice:v1.6.0-gpu - environment: - - ASR_MODEL=base.en - - ASR_ENGINE=faster_whisper - ports: - - 9000:9000 - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: 1 - capabilities: [gpu] - restart: unless-stopped From 0503e1ab275811b8543fc190410e9dfd78602626 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:10:21 -0400 Subject: [PATCH 02/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From 2a0da22b483633adfcf29428931337dadbac40fc Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:11:41 -0400 Subject: [PATCH 03/54] testing tofu --- .forgejo/workflows/tofu.yml | 2 +- terraform/kasm.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index e0e89b2..6ff029c 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -7,7 +7,7 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: docker steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..9fa950a 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 150 interface = "scsi0" } From e8f7757bb2ff9ec97788f61dc89f49444b1d7562 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:15:36 -0400 Subject: [PATCH 04/54] test tofu --- .forgejo/workflows/tofu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 6ff029c..5beb9da 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -8,6 +8,8 @@ on: jobs: deploy: runs-on: docker + container: + image: ubuntu:24.04 steps: - name: Checkout code uses: actions/checkout@v4 From e5691b5be64a9c5a5c2722a9f46bf1352eee3a98 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:16:19 -0400 Subject: [PATCH 05/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From 84ecdd86cc0c43e96c765bd4651d6af215403fb8 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:35:31 -0400 Subject: [PATCH 06/54] fix tofu --- .forgejo/workflows/tofu.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 5beb9da..6a7c462 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -11,6 +11,11 @@ jobs: container: image: ubuntu:24.04 steps: + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 14 + - name: Checkout code uses: actions/checkout@v4 From 43b9dfd58269ce5323b0663d0507bab33c4bb093 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:35:49 -0400 Subject: [PATCH 07/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..9fa950a 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 150 interface = "scsi0" } From a4333940980b2ea828e4204af9f67986ef81d685 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:38:31 -0400 Subject: [PATCH 08/54] fix tofu --- .forgejo/workflows/tofu.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 6a7c462..33ef753 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -9,16 +9,16 @@ jobs: deploy: runs-on: docker container: - image: ubuntu:24.04 + image: sitespeedio/node:ubuntu-22-04-nodejs-20.15.1 steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Node.js uses: actions/setup-node@v4 with: node-version: 14 - - - name: Checkout code - uses: actions/checkout@v4 - + - name: Get Secrets from Bitwarden id: bitwarden-secrets uses: https://github.com/bitwarden/sm-action@v2 From 3116abf4605d4dc33a593e76162a01d9553097f9 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:38:46 -0400 Subject: [PATCH 09/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From 00ca9db4ec597dc670bcf583986cffb456de1176 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:43:53 -0400 Subject: [PATCH 10/54] testing tofu --- .forgejo/workflows/tofu.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 33ef753..43dae10 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -9,16 +9,11 @@ jobs: deploy: runs-on: docker container: - image: sitespeedio/node:ubuntu-22-04-nodejs-20.15.1 + image: node:22 steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 14 - - name: Get Secrets from Bitwarden id: bitwarden-secrets uses: https://github.com/bitwarden/sm-action@v2 From e4a9526cbe5a8dfe8f43b516eac5bdc33f699d20 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:44:04 -0400 Subject: [PATCH 11/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..9fa950a 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 150 interface = "scsi0" } From cde8d222707687a2ac0553610080ee565d18f8e3 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:46:46 -0400 Subject: [PATCH 12/54] test tofu --- .forgejo/workflows/tofu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 43dae10..dd7a10f 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -50,6 +50,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 From 7e3e2ed14854d838576edaf4f81b54e3981db7d5 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:47:03 -0400 Subject: [PATCH 13/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From bbe7bc273eabf5a3cc90375b9ec06479d4711c6f Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:49:18 -0400 Subject: [PATCH 14/54] test tofu --- .forgejo/workflows/tofu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index dd7a10f..b22ef8d 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -48,9 +48,9 @@ jobs: - name: Configure AWS Credentials uses: https://github.com/aws-actions/configure-aws-credentials@v2 env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 From c9b11f8a26fc1deb455750ddfd9efa00f5bf1112 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:49:30 -0400 Subject: [PATCH 15/54] test tofu --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..9fa950a 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 150 interface = "scsi0" } From 42ced803c615155d870952804e492ac35d83ac91 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:52:17 -0400 Subject: [PATCH 16/54] test tofu --- .forgejo/workflows/tofu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index b22ef8d..d266a0c 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -46,7 +46,7 @@ jobs: done - name: Configure AWS Credentials - uses: https://github.com/aws-actions/configure-aws-credentials@v2 + uses: https://github.com/aws-actions/configure-aws-credentials@v4 env: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 2f08399467a6ee1362bc0e64c61055f002826b01 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:52:29 -0400 Subject: [PATCH 17/54] test --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From 48abed5525b6b52f20307a681fc172f1bd9e1a78 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:54:01 -0400 Subject: [PATCH 18/54] test --- .forgejo/workflows/tofu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index d266a0c..c999157 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -50,7 +50,7 @@ jobs: env: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} + aws-region: us-ashburn-1 - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 From c31900eff1059e54137826e3d28ccec4e8573356 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:54:15 -0400 Subject: [PATCH 19/54] test --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From 22c7e355975f00e6b606c637e2a092f41b06f3ad Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 21:59:59 -0400 Subject: [PATCH 20/54] testing --- .forgejo/workflows/tofu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index c999157..aa79bf5 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -50,7 +50,7 @@ jobs: env: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-ashburn-1 + aws-region: ${{ secrets.MY_AWS_REGION }} - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 From c362592138e64db38c22398aa78571d481615d1d Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:00:09 -0400 Subject: [PATCH 21/54] testing --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From 94ce775014195f9eb179fea07530a100ce9cee57 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:08:43 -0400 Subject: [PATCH 22/54] test --- .forgejo/workflows/tofu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index aa79bf5..e300676 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -46,7 +46,7 @@ jobs: done - name: Configure AWS Credentials - uses: https://github.com/aws-actions/configure-aws-credentials@v4 + uses: https://github.com/aws-actions/configure-aws-credentials@master env: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 4a3c92af71bb682e320975a1b3bcb5894f353bb8 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:08:55 -0400 Subject: [PATCH 23/54] test --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..9fa950a 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 150 interface = "scsi0" } From ce025d81f5c6ce5057c90408ea71c9cbd790f40e Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:11:31 -0400 Subject: [PATCH 24/54] test --- .forgejo/workflows/tofu.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index e300676..6f0f4bd 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -45,12 +45,11 @@ jobs: echo "${secret} = \"${{ steps.bitwarden-secrets.outputs[secret] }}\"" >> ./terraform/terraform.tfvars done - - name: Configure AWS Credentials - uses: https://github.com/aws-actions/configure-aws-credentials@master - env: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.MY_AWS_REGION }} + - name: Set AWS Credentials + run: | + echo "[default]" > ~/.aws/credentials + echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials + echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 From 35db934c6a10c7ef79bdc1129ae4296b698cf2a2 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:11:40 -0400 Subject: [PATCH 25/54] test --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 9fa950a..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 150 + size = 151 interface = "scsi0" } From 5e68add5b1d31c43de7bbcfbe5ce443a6c4426b5 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:12:41 -0400 Subject: [PATCH 26/54] test --- .forgejo/workflows/tofu.yml | 3 +++ terraform/kasm.tf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 6f0f4bd..fd2d2e3 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -45,6 +45,9 @@ jobs: echo "${secret} = \"${{ steps.bitwarden-secrets.outputs[secret] }}\"" >> ./terraform/terraform.tfvars done + - name: Create AWS Credentials Directory + run: mkdir -p ~/.aws + - name: Set AWS Credentials run: | echo "[default]" > ~/.aws/credentials diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From fb8cb5ff2bc7d0fbe3137f3f1b1b7e099ded4109 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:13:18 -0400 Subject: [PATCH 27/54] test --- terraform/kasm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..e63bf57 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 153 interface = "scsi0" } From 5533d6e58e5ad870d146a65f9edebcc659dd532e Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:16:15 -0400 Subject: [PATCH 28/54] test --- .forgejo/workflows/tofu.yml | 6 +++--- terraform/kasm.tf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index fd2d2e3..5e09c03 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -58,11 +58,11 @@ jobs: uses: https://github.com/opentofu/setup-opentofu@v1 - name: Run OpenTofu Init - run: tofu init + run: tofu init -chdir=./terraform - name: Run OpenTofu Plan id: plan - run: tofu plan -no-color + run: tofu plan -no-color -chdir=./terraform - name: Display Plan Output run: | @@ -71,4 +71,4 @@ jobs: - name: Apply the Plan if: success() - run: tofu apply -auto-approve + run: tofu apply -auto-approve -chdir=./terraform diff --git a/terraform/kasm.tf b/terraform/kasm.tf index e63bf57..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 153 + size = 152 interface = "scsi0" } From 237d47f13aaf21bf31ef4007642a961ae7bba6d8 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:21:52 -0400 Subject: [PATCH 29/54] test --- .forgejo/workflows/tofu.yml | 9 ++++++--- terraform/kasm.tf | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 5e09c03..9416ae9 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -58,11 +58,13 @@ jobs: uses: https://github.com/opentofu/setup-opentofu@v1 - name: Run OpenTofu Init - run: tofu init -chdir=./terraform + working-directory: ./terraform + run: tofu init - name: Run OpenTofu Plan id: plan - run: tofu plan -no-color -chdir=./terraform + working-directory: ./terraform + run: tofu plan -no-color - name: Display Plan Output run: | @@ -71,4 +73,5 @@ jobs: - name: Apply the Plan if: success() - run: tofu apply -auto-approve -chdir=./terraform + working-directory: ./terraform + run: tofu apply -auto-approve diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From 5df99f2dda1990d36c949d197cc2a69edb485757 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:25:52 -0400 Subject: [PATCH 30/54] test --- .forgejo/workflows/tofu.yml | 27 +++++++++++++++++++++++++-- terraform/kasm.tf | 2 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 9416ae9..3a30e83 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -38,13 +38,36 @@ jobs: a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway + - name: Write secrets to terraform.tfvars + working-directory: ./terraform run: | - SECRETS=("arrbuntu_ip_address" "downloaders_ip_address" "init_password" "kasm_ip" "kasm_ssh_ip" "npm_ip_address" "prox_ip_address" "pve2_ip_address" "s3_endpoint" "ssh_password" "ssh_username" "ubu_ip_address" "virtual_environment_api" "virtual_environment_endpoint" "vlan_gateway") + SECRETS=( + "arrbuntu_ip_address" + "downloaders_ip_address" + "init_password" + "kasm_ip" + "kasm_ssh_ip" + "npm_ip_address" + "prox_ip_address" + "pve2_ip_address" + "s3_endpoint" + "ssh_password" + "ssh_username" + "ubu_ip_address" + "virtual_environment_api" + "virtual_environment_endpoint" + "vlan_gateway" + ) + # Clear previous terraform.tfvars if it exists + > terraform.tfvars + for secret in "${SECRETS[@]}"; do - echo "${secret} = \"${{ steps.bitwarden-secrets.outputs[secret] }}\"" >> ./terraform/terraform.tfvars + value="${{ steps.bitwarden-secrets.outputs[secret] }}" + echo "${secret} = \"${value}\"" >> terraform.tfvars done + - name: Create AWS Credentials Directory run: mkdir -p ~/.aws diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From 0e893d6240a77d0fc1078ce6f0d35a5cc396d561 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:41:30 -0400 Subject: [PATCH 31/54] test tofu --- .forgejo/workflows/tofu.yml | 58 ++----------------------------------- terraform/kasm.tf | 2 +- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 3a30e83..3f8e32e 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -14,60 +14,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Get Secrets from Bitwarden - id: bitwarden-secrets - uses: https://github.com/bitwarden/sm-action@v2 - with: - access_token: ${{ secrets.BW_ACCESS_TOKEN }} - base_url: https://vault.bitwarden.com - secrets: | - c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address - a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address - dacbeafa-c671-4b9c-9334-b2080006f75b > init_password - 9ceabbd0-6492-4674-9bab-b2080006e333 > init_username - 0bc3c1a3-fc48-48ce-85c5-b2080007136a > kasm_ip - 63ca1819-5090-4e30-9dba-b20800072718 > kasm_ssh_ip - 47ef68aa-32a9-45b0-835d-b2080006ce38 > npm_ip_address - d0c7f3ec-8277-4b1b-9a1b-b2080006b842 > prox_ip_address - 17ab7869-c7a1-4ece-8c64-b20800075213 > pve2_ip_address - f8f85ab2-5f6d-46a7-9e06-b20800076d26 > s3_endpoint - 68f1d77d-4e96-498a-9464-b208000679a4 > ssh_password - d0762ced-73de-4f30-aa1c-b20800069536 > ssh_username - d8017351-7a11-42e6-9e8d-b208000739b8 > ubu_ip_address - 1d250f4a-ae18-4e19-934c-b2080005e132 > virtual_environment_api - a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint - af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - - - - name: Write secrets to terraform.tfvars - working-directory: ./terraform - run: | - SECRETS=( - "arrbuntu_ip_address" - "downloaders_ip_address" - "init_password" - "kasm_ip" - "kasm_ssh_ip" - "npm_ip_address" - "prox_ip_address" - "pve2_ip_address" - "s3_endpoint" - "ssh_password" - "ssh_username" - "ubu_ip_address" - "virtual_environment_api" - "virtual_environment_endpoint" - "vlan_gateway" - ) - # Clear previous terraform.tfvars if it exists - > terraform.tfvars - - for secret in "${SECRETS[@]}"; do - value="${{ steps.bitwarden-secrets.outputs[secret] }}" - echo "${secret} = \"${value}\"" >> terraform.tfvars - done - - - name: Create AWS Credentials Directory run: mkdir -p ~/.aws @@ -79,7 +25,9 @@ jobs: - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 - + with: + cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} + - name: Run OpenTofu Init working-directory: ./terraform run: tofu init diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From 72d6bc68442ec592fa56cc6322c28833f394eb3b Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 22:55:38 -0400 Subject: [PATCH 32/54] test --- .forgejo/workflows/tofu.yml | 4 +--- terraform/kasm.tf | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 3f8e32e..2988a8f 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -25,9 +25,7 @@ jobs: - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1 - with: - cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - + - name: Run OpenTofu Init working-directory: ./terraform run: tofu init diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From e668f019fb37932882cc4c8cc773569f7851a6ae Mon Sep 17 00:00:00 2001 From: mafyuh Date: Sat, 12 Oct 2024 23:14:08 -0400 Subject: [PATCH 33/54] Add terraform/secrets.tfvars --- terraform/secrets.tfvars | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 terraform/secrets.tfvars diff --git a/terraform/secrets.tfvars b/terraform/secrets.tfvars new file mode 100644 index 0000000..ff7e4e1 --- /dev/null +++ b/terraform/secrets.tfvars @@ -0,0 +1,15 @@ +arrbuntu_ip_address = "" +downloaders_ip_address = "" +init_password = "" +kasm_ip = "" +kasm_ssh_ip = "" +npm_ip_address = "" +prox_ip_address = "" +pve2_ip_address = "" +s3_endpoint = "" +ssh_password = "" +ssh_username = "" +ubu_ip_address = "" +virtual_environment_api = "" +virtual_environment_endpoint = "" +vlan_gateway = "" From d3c9588ab95227f4bc5740aa42e05e48d2a90eb3 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:18:20 -0400 Subject: [PATCH 34/54] test --- .forgejo/workflows/tofu.yml | 42 +++++++++++++++++++++++++++++++++++++ terraform/kasm.tf | 2 +- terraform/vars.tf | 4 ---- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 2988a8f..c33e963 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -14,6 +14,48 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Get Secrets from Bitwarden + id: bitwarden-secrets + uses: https://github.com/bitwarden/sm-action@v2 + with: + access_token: ${{ secrets.BW_ACCESS_TOKEN }} + base_url: https://vault.bitwarden.com + secrets: | + c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address + a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address + dacbeafa-c671-4b9c-9334-b2080006f75b > init_password + 9ceabbd0-6492-4674-9bab-b2080006e333 > init_username + 0bc3c1a3-fc48-48ce-85c5-b2080007136a > kasm_ip + 63ca1819-5090-4e30-9dba-b20800072718 > kasm_ssh_ip + 47ef68aa-32a9-45b0-835d-b2080006ce38 > npm_ip_address + d0c7f3ec-8277-4b1b-9a1b-b2080006b842 > prox_ip_address + 17ab7869-c7a1-4ece-8c64-b20800075213 > pve2_ip_address + f8f85ab2-5f6d-46a7-9e06-b20800076d26 > s3_endpoint + 68f1d77d-4e96-498a-9464-b208000679a4 > ssh_password + d0762ced-73de-4f30-aa1c-b20800069536 > ssh_username + d8017351-7a11-42e6-9e8d-b208000739b8 > ubu_ip_address + 1d250f4a-ae18-4e19-934c-b2080005e132 > virtual_environment_api + a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint + af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway + + - name: Write secrets to secrets.tfvars + run: | + echo "arrbuntu_ip_address = \"${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "downloaders_ip_address = \"${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "init_password = \"${{ steps.bitwarden-secrets.outputs.init_password }}\"" >> ./terraform/secrets.tfvars + echo "kasm_ip = \"${{ steps.bitwarden-secrets.outputs.kasm_ip }}\"" >> ./terraform/secrets.tfvars + echo "kasm_ssh_ip = \"${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}\"" >> ./terraform/secrets.tfvars + echo "npm_ip_address = \"${{ steps.bitwarden-secrets.outputs.npm_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "prox_ip_address = \"${{ steps.bitwarden-secrets.outputs.prox_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "pve2_ip_address = \"${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "s3_endpoint = \"${{ steps.bitwarden-secrets.outputs.s3_endpoint }}\"" >> ./terraform/secrets.tfvars + echo "ssh_password = \"${{ steps.bitwarden-secrets.outputs.ssh_password }}\"" >> ./terraform/secrets.tfvars + echo "ssh_username = \"${{ steps.bitwarden-secrets.outputs.ssh_username }}\"" >> ./terraform/secrets.tfvars + echo "ubu_ip_address = \"${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}\"" >> ./terraform/secrets.tfvars + echo "virtual_environment_api = \"${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}\"" >> ./terraform/secrets.tfvars + echo "virtual_environment_endpoint = \"${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}\"" >> ./terraform/secrets.tfvars + echo "vlan_gateway = \"${{ steps.bitwarden-secrets.outputs.vlan_gateway }}\"" >> ./terraform/secrets.tfvars + - name: Create AWS Credentials Directory run: mkdir -p ~/.aws diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } diff --git a/terraform/vars.tf b/terraform/vars.tf index 60ca8e4..84b1af3 100644 --- a/terraform/vars.tf +++ b/terraform/vars.tf @@ -18,10 +18,6 @@ variable "downloaders_ip_address" { type = string } -variable "whisper_ip_address" { - type = string -} - variable "ssh_password" { type = string } From 450f2b929a62451fe284b2dc3fbe96a59410172c Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:24:34 -0400 Subject: [PATCH 35/54] test --- .forgejo/workflows/tofu.yml | 2 +- terraform/kasm.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index c33e963..5cc8505 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -70,7 +70,7 @@ jobs: - name: Run OpenTofu Init working-directory: ./terraform - run: tofu init + run: tofu init -var-file=secrets.tfvars - name: Run OpenTofu Plan id: plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From 63aad3e67b877cb0d05ceedba7a5c92487a5333e Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:27:12 -0400 Subject: [PATCH 36/54] test --- .forgejo/workflows/tofu.yml | 1 + terraform/kasm.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 5cc8505..2573943 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -40,6 +40,7 @@ jobs: - name: Write secrets to secrets.tfvars run: | + rm -f ./terraform/secrets.tfvars echo "arrbuntu_ip_address = \"${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}\"" >> ./terraform/secrets.tfvars echo "downloaders_ip_address = \"${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}\"" >> ./terraform/secrets.tfvars echo "init_password = \"${{ steps.bitwarden-secrets.outputs.init_password }}\"" >> ./terraform/secrets.tfvars diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From f37830c7ae4dd7b1520127cc2ef26295714346af Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:37:28 -0400 Subject: [PATCH 37/54] test --- .forgejo/workflows/tofu.yml | 36 +++++++++++++++++++----------------- terraform/kasm.tf | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 2573943..aa91237 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -38,24 +38,26 @@ jobs: a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - - name: Write secrets to secrets.tfvars + - name: Set Environment Variables + env: + arrbuntu_ip_address: ${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }} + downloaders_ip_address: ${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }} + init_password: ${{ steps.bitwarden-secrets.outputs.init_password }} + init_username: ${{ steps.bitwarden-secrets.outputs.init_username }} + kasm_ip: ${{ steps.bitwarden-secrets.outputs.kasm_ip }} + kasm_ssh_ip: ${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }} + npm_ip_address: ${{ steps.bitwarden-secrets.outputs.npm_ip_address }} + prox_ip_address: ${{ steps.bitwarden-secrets.outputs.prox_ip_address }} + pve2_ip_address: ${{ steps.bitwarden-secrets.outputs.pve2_ip_address }} + s3_endpoint: ${{ steps.bitwarden-secrets.outputs.s3_endpoint }} + ssh_password: ${{ steps.bitwarden-secrets.outputs.ssh_password }} + ssh_username: ${{ steps.bitwarden-secrets.outputs.ssh_username }} + ubu_ip_address: ${{ steps.bitwarden-secrets.outputs.ubu_ip_address }} + virtual_environment_api: ${{ steps.bitwarden-secrets.outputs.virtual_environment_api }} + virtual_environment_endpoint: ${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }} + vlan_gateway: ${{ steps.bitwarden-secrets.outputs.vlan_gateway }} run: | - rm -f ./terraform/secrets.tfvars - echo "arrbuntu_ip_address = \"${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "downloaders_ip_address = \"${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "init_password = \"${{ steps.bitwarden-secrets.outputs.init_password }}\"" >> ./terraform/secrets.tfvars - echo "kasm_ip = \"${{ steps.bitwarden-secrets.outputs.kasm_ip }}\"" >> ./terraform/secrets.tfvars - echo "kasm_ssh_ip = \"${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}\"" >> ./terraform/secrets.tfvars - echo "npm_ip_address = \"${{ steps.bitwarden-secrets.outputs.npm_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "prox_ip_address = \"${{ steps.bitwarden-secrets.outputs.prox_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "pve2_ip_address = \"${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "s3_endpoint = \"${{ steps.bitwarden-secrets.outputs.s3_endpoint }}\"" >> ./terraform/secrets.tfvars - echo "ssh_password = \"${{ steps.bitwarden-secrets.outputs.ssh_password }}\"" >> ./terraform/secrets.tfvars - echo "ssh_username = \"${{ steps.bitwarden-secrets.outputs.ssh_username }}\"" >> ./terraform/secrets.tfvars - echo "ubu_ip_address = \"${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}\"" >> ./terraform/secrets.tfvars - echo "virtual_environment_api = \"${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}\"" >> ./terraform/secrets.tfvars - echo "virtual_environment_endpoint = \"${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}\"" >> ./terraform/secrets.tfvars - echo "vlan_gateway = \"${{ steps.bitwarden-secrets.outputs.vlan_gateway }}\"" >> ./terraform/secrets.tfvars + echo "Environment variables are set" - name: Create AWS Credentials Directory run: mkdir -p ~/.aws diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From ec41d22928d0f1e0ac3d41bc280f200fc77be94b Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:40:24 -0400 Subject: [PATCH 38/54] test --- .forgejo/workflows/tofu.yml | 2 ++ terraform/kasm.tf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index aa91237..e8b27ab 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -56,6 +56,8 @@ jobs: virtual_environment_api: ${{ steps.bitwarden-secrets.outputs.virtual_environment_api }} virtual_environment_endpoint: ${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }} vlan_gateway: ${{ steps.bitwarden-secrets.outputs.vlan_gateway }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} run: | echo "Environment variables are set" diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From 41bec8b508874d8af9d26bf37f50e394c72f533f Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:41:11 -0400 Subject: [PATCH 39/54] test --- .forgejo/workflows/tofu.yml | 2 +- terraform/kasm.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index e8b27ab..a691945 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -75,7 +75,7 @@ jobs: - name: Run OpenTofu Init working-directory: ./terraform - run: tofu init -var-file=secrets.tfvars + run: tofu init - name: Run OpenTofu Plan id: plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From 59d6a0c8431a8ae454ede165b235d875c5768b60 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:46:21 -0400 Subject: [PATCH 40/54] test --- .forgejo/workflows/tofu.yml | 43 ++++++++++++++++--------------------- terraform/kasm.tf | 2 +- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index a691945..0adcd6c 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -38,29 +38,6 @@ jobs: a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - - name: Set Environment Variables - env: - arrbuntu_ip_address: ${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }} - downloaders_ip_address: ${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }} - init_password: ${{ steps.bitwarden-secrets.outputs.init_password }} - init_username: ${{ steps.bitwarden-secrets.outputs.init_username }} - kasm_ip: ${{ steps.bitwarden-secrets.outputs.kasm_ip }} - kasm_ssh_ip: ${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }} - npm_ip_address: ${{ steps.bitwarden-secrets.outputs.npm_ip_address }} - prox_ip_address: ${{ steps.bitwarden-secrets.outputs.prox_ip_address }} - pve2_ip_address: ${{ steps.bitwarden-secrets.outputs.pve2_ip_address }} - s3_endpoint: ${{ steps.bitwarden-secrets.outputs.s3_endpoint }} - ssh_password: ${{ steps.bitwarden-secrets.outputs.ssh_password }} - ssh_username: ${{ steps.bitwarden-secrets.outputs.ssh_username }} - ubu_ip_address: ${{ steps.bitwarden-secrets.outputs.ubu_ip_address }} - virtual_environment_api: ${{ steps.bitwarden-secrets.outputs.virtual_environment_api }} - virtual_environment_endpoint: ${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }} - vlan_gateway: ${{ steps.bitwarden-secrets.outputs.vlan_gateway }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - run: | - echo "Environment variables are set" - - name: Create AWS Credentials Directory run: mkdir -p ~/.aws @@ -75,7 +52,25 @@ jobs: - name: Run OpenTofu Init working-directory: ./terraform - run: tofu init + run: | + tofu init \ + -var "arrbuntu_ip_address=${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}" \ + -var "downloaders_ip_address=${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}" \ + -var "init_password=${{ steps.bitwarden-secrets.outputs.init_password }}" \ + -var "init_username=${{ steps.bitwarden-secrets.outputs.init_username }}" \ + -var "kasm_ip=${{ steps.bitwarden-secrets.outputs.kasm_ip }}" \ + -var "kasm_ssh_ip=${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}" \ + -var "npm_ip_address=${{ steps.bitwarden-secrets.outputs.npm_ip_address }}" \ + -var "prox_ip_address=${{ steps.bitwarden-secrets.outputs.prox_ip_address }}" \ + -var "pve2_ip_address=${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}" \ + -var "s3_endpoint=${{ steps.bitwarden-secrets.outputs.s3_endpoint }}" \ + -var "ssh_password=${{ steps.bitwarden-secrets.outputs.ssh_password }}" \ + -var "ssh_username=${{ steps.bitwarden-secrets.outputs.ssh_username }}" \ + -var "ubu_ip_address=${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}" \ + -var "virtual_environment_api=${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}" \ + -var "virtual_environment_endpoint=${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}" \ + -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" + - name: Run OpenTofu Plan id: plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From 4692330417fff75e287d3d198a3cb645614ceb72 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:54:18 -0400 Subject: [PATCH 41/54] test --- .forgejo/workflows/tofu.yml | 6 ++++-- terraform/kasm.tf | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 0adcd6c..a729a55 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -47,8 +47,9 @@ jobs: echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials + - name: Setup OpenTofu - uses: https://github.com/opentofu/setup-opentofu@v1 + uses: https://github.com/opentofu/setup-opentofu@v1.0.4 - name: Run OpenTofu Init working-directory: ./terraform @@ -69,7 +70,8 @@ jobs: -var "ubu_ip_address=${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}" \ -var "virtual_environment_api=${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}" \ -var "virtual_environment_endpoint=${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}" \ - -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" + -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" \ + -var "AWS_EC2_METADATA_DISABLED=true" - name: Run OpenTofu Plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From 7e6a43ed09745af621068c7f481777d9cedae49e Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sat, 12 Oct 2024 23:55:20 -0400 Subject: [PATCH 42/54] test --- .forgejo/workflows/tofu.yml | 6 ++++-- terraform/kasm.tf | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index a729a55..0399581 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -47,6 +47,9 @@ jobs: echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials + - name: Set Environment Variables + run: echo "AWS_EC2_METADATA_DISABLED=true" >> $GITHUB_ENV + - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1.0.4 @@ -70,8 +73,7 @@ jobs: -var "ubu_ip_address=${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}" \ -var "virtual_environment_api=${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}" \ -var "virtual_environment_endpoint=${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}" \ - -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" \ - -var "AWS_EC2_METADATA_DISABLED=true" + -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" - name: Run OpenTofu Plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From c98fb40f46609b41ef93ffc1f7c029c3a8b1933d Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 10:22:23 -0400 Subject: [PATCH 43/54] test --- .forgejo/workflows/tofu.yml | 14 +++++--------- terraform/kasm.tf | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 0399581..ad97c7f 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -38,17 +38,13 @@ jobs: a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - - name: Create AWS Credentials Directory - run: mkdir -p ~/.aws - - name: Set AWS Credentials + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | - echo "[default]" > ~/.aws/credentials - echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials - echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials - - - name: Set Environment Variables - run: echo "AWS_EC2_METADATA_DISABLED=true" >> $GITHUB_ENV + echo "AWS Credentials Set" - name: Setup OpenTofu diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From ef5c58d015618c178206a7e6a47c7cc9c4e09008 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 10:48:04 -0400 Subject: [PATCH 44/54] test --- .forgejo/workflows/tofu.yml | 12 +++++------- terraform/kasm.tf | 2 +- terraform/provider.tf | 2 ++ terraform/vars.tf | 8 ++++++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index ad97c7f..83e0da9 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -22,6 +22,8 @@ jobs: base_url: https://vault.bitwarden.com secrets: | c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address + 2dae51bd-bd65-474c-971c-b20800f22afa > aws_access_key_id + 287c852d-f2b5-467d-bfc4-b20800f25f52 > aws_secret_access_key a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address dacbeafa-c671-4b9c-9334-b2080006f75b > init_password 9ceabbd0-6492-4674-9bab-b2080006e333 > init_username @@ -38,13 +40,7 @@ jobs: a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - - name: Set AWS Credentials - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - run: | - echo "AWS Credentials Set" + - name: Setup OpenTofu @@ -55,6 +51,8 @@ jobs: run: | tofu init \ -var "arrbuntu_ip_address=${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}" \ + -var "aws_access_key_id=${{ steps.bitwarden-secrets.outputs.aws_access_key_id }}" \ + -var "aws_secret_access_key=${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }}" \ -var "downloaders_ip_address=${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}" \ -var "init_password=${{ steps.bitwarden-secrets.outputs.init_password }}" \ -var "init_username=${{ steps.bitwarden-secrets.outputs.init_username }}" \ diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } diff --git a/terraform/provider.tf b/terraform/provider.tf index e76e1b8..d081208 100644 --- a/terraform/provider.tf +++ b/terraform/provider.tf @@ -19,6 +19,8 @@ terraform { endpoints = { s3 = var.s3_endpoint } + access_key = var.aws_access_key_id + secret_key = var.aws_secret_access_key } } diff --git a/terraform/vars.tf b/terraform/vars.tf index 84b1af3..55340df 100644 --- a/terraform/vars.tf +++ b/terraform/vars.tf @@ -60,4 +60,12 @@ variable "pve2_ip_address" { variable "s3_endpoint" { type = string +} + +variable "aws_secret_access_key" { + type = string +} + +variable "aws_access_key_id" { + type = string } \ No newline at end of file From 56508371d23f33d0c090b9cc326f59a7f5769c32 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 11:05:29 -0400 Subject: [PATCH 45/54] testing --- .forgejo/workflows/tofu.yml | 44 ++++++++++++++++++++----------------- terraform/kasm.tf | 2 +- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 83e0da9..6ec269c 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -41,7 +41,29 @@ jobs: af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway - + - name: Create tfvars file + working-directory: ./terraform + run: | + cat < terraform.tfvars + arrbuntu_ip_address = "${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}" + aws_access_key_id = "${{ steps.bitwarden-secrets.outputs.aws_access_key_id }}" + aws_secret_access_key = "${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }}" + downloaders_ip_address = "${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}" + init_password = "${{ steps.bitwarden-secrets.outputs.init_password }}" + init_username = "${{ steps.bitwarden-secrets.outputs.init_username }}" + kasm_ip = "${{ steps.bitwarden-secrets.outputs.kasm_ip }}" + kasm_ssh_ip = "${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}" + npm_ip_address = "${{ steps.bitwarden-secrets.outputs.npm_ip_address }}" + prox_ip_address = "${{ steps.bitwarden-secrets.outputs.prox_ip_address }}" + pve2_ip_address = "${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}" + s3_endpoint = "${{ steps.bitwarden-secrets.outputs.s3_endpoint }}" + ssh_password = "${{ steps.bitwarden-secrets.outputs.ssh_password }}" + ssh_username = "${{ steps.bitwarden-secrets.outputs.ssh_username }}" + ubu_ip_address = "${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}" + virtual_environment_api = "${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}" + virtual_environment_endpoint = "${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}" + vlan_gateway = "${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" + EOF - name: Setup OpenTofu uses: https://github.com/opentofu/setup-opentofu@v1.0.4 @@ -49,25 +71,7 @@ jobs: - name: Run OpenTofu Init working-directory: ./terraform run: | - tofu init \ - -var "arrbuntu_ip_address=${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}" \ - -var "aws_access_key_id=${{ steps.bitwarden-secrets.outputs.aws_access_key_id }}" \ - -var "aws_secret_access_key=${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }}" \ - -var "downloaders_ip_address=${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}" \ - -var "init_password=${{ steps.bitwarden-secrets.outputs.init_password }}" \ - -var "init_username=${{ steps.bitwarden-secrets.outputs.init_username }}" \ - -var "kasm_ip=${{ steps.bitwarden-secrets.outputs.kasm_ip }}" \ - -var "kasm_ssh_ip=${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}" \ - -var "npm_ip_address=${{ steps.bitwarden-secrets.outputs.npm_ip_address }}" \ - -var "prox_ip_address=${{ steps.bitwarden-secrets.outputs.prox_ip_address }}" \ - -var "pve2_ip_address=${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}" \ - -var "s3_endpoint=${{ steps.bitwarden-secrets.outputs.s3_endpoint }}" \ - -var "ssh_password=${{ steps.bitwarden-secrets.outputs.ssh_password }}" \ - -var "ssh_username=${{ steps.bitwarden-secrets.outputs.ssh_username }}" \ - -var "ubu_ip_address=${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}" \ - -var "virtual_environment_api=${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}" \ - -var "virtual_environment_endpoint=${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}" \ - -var "vlan_gateway=${{ steps.bitwarden-secrets.outputs.vlan_gateway }}" + tofu init -var-file=terraform.tfvars - name: Run OpenTofu Plan diff --git a/terraform/kasm.tf b/terraform/kasm.tf index f48bc29..22ae455 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 151 + size = 152 interface = "scsi0" } From e55e394d537f2d9b4947226670e370502a1112db Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 11:18:37 -0400 Subject: [PATCH 46/54] test --- terraform/cloud-init.tf | 17 +++++++---------- terraform/kasm.tf | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/terraform/cloud-init.tf b/terraform/cloud-init.tf index f322133..074e1d5 100644 --- a/terraform/cloud-init.tf +++ b/terraform/cloud-init.tf @@ -1,9 +1,6 @@ -data "local_file" "ssh_public_key" { - filename = "/home/mafyuh/.ssh/main_key.pub" -} - -data "local_file" "ssh_public_key_2" { - filename = "/home/mafyuh/.ssh/id_rsa.pub" +locals { + ssh_public_key_1 = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDndt2pi7jZx0qY1qn/UEn2AcZThxCQBvIGNytlPDz1cFNHjB1lGgHdI4uCw7fu2ET6/vpqHxjdQqB/Ehj2fajw1L2zncKB93NMv3pcq7ZJGwIgdw26vfBQZWFazaPk7O5rOGO1hWohE4YlejpOHYGCFs1pUxaC8DQPR0M6GvnccWxzJhpiO+NUeU8F/NC1uKLyypK8CpTmjVQaiTSgn/RorTf7A6sdzfWFndM7k6hw5NqqKVk0OhDfy/XCGQrIRh6/yxFbbthAUJgd8/djELlc7XQaG0nMSBtu6m8+VmMN8XO7FZmus8PwlcXPIhwos+vJlh2+xU+E7Ciwyw4WytCjuw67rL4REbdOh+zqZm//OMswvTxtDiRbTXTsOXqgyh5cOUcNub3UdAl6e7c2ZQT5lz5ZVCNNLVrFigvRE813YlKsoYu1p4XrtyHodeYEXgoLjU0jgRj0EmBEDriafo84lamHK7zItZllNH9hHKWs+iXiQQ4nVD65Ng0mYmM9OF76corqfIuQWkQd8kN2r5a0UHrl+tkhZOY3x3PB9r88yCPRdSkW8ICFObQ069yE4HU9kA41rVPXOU8zxK8UT2svTM0YRcDcfr2VUktU0wEP1ASv8nOAdvq7+pcqpoKrw3sZyyeLncxSAfJCRMjJvUDww92YSTjG4TCwY2gcPXRsww== Generated By Termius" + ssh_public_key_2 = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCt9kj7JcJVf8zfzLlsDv12d9dV7J4SM+Wrq7fWMUseCzl7BK3SX+cNFYWbkZsDsp81VtXrqXDpImIGc9KtRy1tvNmrd/+xlj6aVFH9tHYq//5pOC2C4wcf3wVlSazdhZ64qVwY4glr1Bs4M02GZ92VDjb51JvByl5kfgiKLqRiFyJHv9f5FYEfZqdLY+SKjd7H6fjhMTFTcyfXeGaifUTqogDXPLzk0iP0rx7C3oHOfsKKhZvUe/la9uYJGdbSeQX1H59KOVJQ7UQxr7wn+uu5e7IPPXiBoR4dBU8pAmtWgLo9F0ZdXgu2bOunUBIeL2/dj6xFCI3ZrQ3mLe+upoyhqLKh4+qi5SeQNcqXi7pHhcA1hGzmOMDrPXV/2DA0NcJ6v43qJFRn+Qp8Oy/zApvQ6F/opLhX0yghEc5ltmj+MPMom4ykKxpuGPUHxNplMgmVG+V/YlRXG9BATsQX35kt2lqivX9L4XppgJHhby0bJnZQKozExCn67w1rSW7MvYyo/W7aXK7ZGLIeH7sxqwwisQlbMjhVzYcods1p+JDi1VhNQUsc4nDA0ghk9PiSY11pwAvvzds46wZLMrxlNeIs2cEdghIi+5QO68qvZHODHrtiAn3yJ7qjarx5qOx5oe2DX2duY6/7cUEnwQFNX5z4hfeCCThz9jIn316Jk/oeXQ== admin@mafyuh.io" } resource "proxmox_virtual_environment_file" "cloud_config" { @@ -22,8 +19,8 @@ resource "proxmox_virtual_environment_file" "cloud_config" { - docker shell: /bin/bash ssh_authorized_keys: - - ${trimspace(data.local_file.ssh_public_key.content)} - - ${trimspace(data.local_file.ssh_public_key_2.content)} + - ${trimspace(local.ssh_public_key)} + - ${trimspace(local.ssh_public_key_2)} sudo: ALL=(ALL) NOPASSWD:ALL runcmd: - apt update @@ -58,8 +55,8 @@ resource "proxmox_virtual_environment_file" "cloud_config2" { - docker shell: /bin/bash ssh_authorized_keys: - - ${trimspace(data.local_file.ssh_public_key.content)} - - ${trimspace(data.local_file.ssh_public_key_2.content)} + - ${trimspace(local.ssh_public_key)} + - ${trimspace(local.ssh_public_key_2)} sudo: ALL=(ALL) NOPASSWD:ALL runcmd: - apt update diff --git a/terraform/kasm.tf b/terraform/kasm.tf index 22ae455..f48bc29 100644 --- a/terraform/kasm.tf +++ b/terraform/kasm.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" { # VM Disk Settings disk { datastore_id = "local-lvm" - size = 152 + size = 151 interface = "scsi0" } From cf67c7cd23e056c7d21c02319d324e6fdae589e3 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 11:20:22 -0400 Subject: [PATCH 47/54] test --- terraform/cloud-init.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/cloud-init.tf b/terraform/cloud-init.tf index 074e1d5..2202ec2 100644 --- a/terraform/cloud-init.tf +++ b/terraform/cloud-init.tf @@ -19,7 +19,7 @@ resource "proxmox_virtual_environment_file" "cloud_config" { - docker shell: /bin/bash ssh_authorized_keys: - - ${trimspace(local.ssh_public_key)} + - ${trimspace(local.ssh_public_key_1)} - ${trimspace(local.ssh_public_key_2)} sudo: ALL=(ALL) NOPASSWD:ALL runcmd: From ce7c0c1a46f8609dd357ad9bb03c8320f9de6f30 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 11:20:51 -0400 Subject: [PATCH 48/54] test --- terraform/cloud-init.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/cloud-init.tf b/terraform/cloud-init.tf index 2202ec2..e5f2125 100644 --- a/terraform/cloud-init.tf +++ b/terraform/cloud-init.tf @@ -55,7 +55,7 @@ resource "proxmox_virtual_environment_file" "cloud_config2" { - docker shell: /bin/bash ssh_authorized_keys: - - ${trimspace(local.ssh_public_key)} + - ${trimspace(local.ssh_public_key_1)} - ${trimspace(local.ssh_public_key_2)} sudo: ALL=(ALL) NOPASSWD:ALL runcmd: From 3ee1613978e9a46897757e6a6785974505de94dd Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 16:20:24 -0400 Subject: [PATCH 49/54] add ntp playbook --- ansible/playbooks/ntp.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ansible/playbooks/ntp.yml diff --git a/ansible/playbooks/ntp.yml b/ansible/playbooks/ntp.yml new file mode 100644 index 0000000..dccd146 --- /dev/null +++ b/ansible/playbooks/ntp.yml @@ -0,0 +1,33 @@ +--- +- name: Configure systemd-timesyncd to use router NTP server + hosts: all + become: true + + tasks: + - name: Ensure systemd-timesyncd is installed + apt: + name: systemd-timesyncd + state: present + update_cache: yes + + - name: Configure timesyncd to use the router's NTP server + lineinfile: + path: /etc/systemd/timesyncd.conf + regexp: '^NTP=' + line: 'NTP=10.0.0.1' + insertafter: '^\[Time\]' + state: present + + - name: Restart systemd-timesyncd to apply changes + systemd: + name: systemd-timesyncd + state: restarted + enabled: yes + + - name: Verify the NTP configuration + command: timedatectl status + register: timesync_status + + - name: Show the status of time synchronization + debug: + msg: "{{ timesync_status.stdout }}" From 5e34685a075948baa834e60b637766ef8a9d6da1 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 16:37:39 -0400 Subject: [PATCH 50/54] fix ntp --- ansible/playbooks/ntp.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ansible/playbooks/ntp.yml b/ansible/playbooks/ntp.yml index dccd146..7097814 100644 --- a/ansible/playbooks/ntp.yml +++ b/ansible/playbooks/ntp.yml @@ -10,13 +10,12 @@ state: present update_cache: yes - - name: Configure timesyncd to use the router's NTP server - lineinfile: + - name: Configure timesyncd to use the router's NTP server using ini_file + ini_file: path: /etc/systemd/timesyncd.conf - regexp: '^NTP=' - line: 'NTP=10.0.0.1' - insertafter: '^\[Time\]' - state: present + section: Time + option: NTP + value: '10.0.0.1' - name: Restart systemd-timesyncd to apply changes systemd: From 169caf0b6b592eeffc2fabe6dd86feb67038bd09 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 16:39:05 -0400 Subject: [PATCH 51/54] test ntp --- ansible/playbooks/ntp.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ansible/playbooks/ntp.yml b/ansible/playbooks/ntp.yml index 7097814..abfc0ed 100644 --- a/ansible/playbooks/ntp.yml +++ b/ansible/playbooks/ntp.yml @@ -10,12 +10,9 @@ state: present update_cache: yes - - name: Configure timesyncd to use the router's NTP server using ini_file - ini_file: - path: /etc/systemd/timesyncd.conf - section: Time - option: NTP - value: '10.0.0.1' + - name: Configure timesyncd to use the router's NTP server + shell: sed -i '/^NTP=/c\NTP=10.0.0.1' /etc/systemd/timesyncd.conf + - name: Restart systemd-timesyncd to apply changes systemd: From efa91713e6e867b39bbbb1441e1853331344c5fb Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 13 Oct 2024 15:00:33 +0000 Subject: [PATCH 52/54] :arrow_up: Update vaultwarden/server Docker tag to v1.32.2 --- docker/arm/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/arm/docker-compose.yml b/docker/arm/docker-compose.yml index 8716ca3..ac85c10 100644 --- a/docker/arm/docker-compose.yml +++ b/docker/arm/docker-compose.yml @@ -148,7 +148,7 @@ services: - gitea_main vaultwarden: - image: vaultwarden/server:1.32.1 + image: vaultwarden/server:1.32.2 container_name: vaultwarden ports: - 8989:80 From 1b0242360e21046d3e3f8e9a1bddda672b2117ae Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 13 Oct 2024 14:00:36 +0000 Subject: [PATCH 53/54] :arrow_up: Update bellamy/wallos Docker tag to v2.30.0 --- docker/cf/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/cf/docker-compose.yml b/docker/cf/docker-compose.yml index 4df9a2a..ffa709d 100644 --- a/docker/cf/docker-compose.yml +++ b/docker/cf/docker-compose.yml @@ -7,7 +7,7 @@ services: wallos: container_name: wallos - image: bellamy/wallos:2.29.2 + image: bellamy/wallos:2.30.0 ports: - "8282:80/tcp" environment: From 71e90683c81b12ad544b2ac8dc668796a8abeeba Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Sun, 13 Oct 2024 20:42:58 -0400 Subject: [PATCH 54/54] test tofu --- .forgejo/workflows/tofu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 6ec269c..34726e2 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -2,6 +2,8 @@ name: OpenTofu Automation on: push: + branches: + - main paths: - 'terraform/**'