Skip to content

Commit ae28499

Browse files
committedOct 13, 2024
fix tf apply
1 parent 56ccc07 commit ae28499

File tree

2 files changed

+51
-33
lines changed

2 files changed

+51
-33
lines changed
 

‎.forgejo/workflows/tofu.yml

+51-14
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,69 @@
1-
name: Terraform Apply
1+
name: OpenTofu Automation
22

33
on:
44
push:
55
paths:
66
- 'terraform/**'
77

88
jobs:
9-
terraform:
9+
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
1313
uses: actions/checkout@v4
1414

15-
- name: Download OpenTofu Installer
15+
- name: Get Secrets from Bitwarden
16+
id: bitwarden-secrets
17+
uses: https://github.com/bitwarden/sm-action@v2
18+
with:
19+
access_token: ${{ secrets.BW_ACCESS_TOKEN }}
20+
base_url: https://vault.bitwarden.com
21+
secrets: |
22+
c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address
23+
a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address
24+
dacbeafa-c671-4b9c-9334-b2080006f75b > init_password
25+
9ceabbd0-6492-4674-9bab-b2080006e333 > init_username
26+
0bc3c1a3-fc48-48ce-85c5-b2080007136a > kasm_ip
27+
63ca1819-5090-4e30-9dba-b20800072718 > kasm_ssh_ip
28+
47ef68aa-32a9-45b0-835d-b2080006ce38 > npm_ip_address
29+
d0c7f3ec-8277-4b1b-9a1b-b2080006b842 > prox_ip_address
30+
17ab7869-c7a1-4ece-8c64-b20800075213 > pve2_ip_address
31+
f8f85ab2-5f6d-46a7-9e06-b20800076d26 > s3_endpoint
32+
68f1d77d-4e96-498a-9464-b208000679a4 > ssh_password
33+
d0762ced-73de-4f30-aa1c-b20800069536 > ssh_username
34+
d8017351-7a11-42e6-9e8d-b208000739b8 > ubu_ip_address
35+
1d250f4a-ae18-4e19-934c-b2080005e132 > virtual_environment_api
36+
a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint
37+
af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway
38+
39+
- name: Write secrets to terraform.tfvars
1640
run: |
17-
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
18-
chmod +x install-opentofu.sh
41+
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")
42+
for secret in "${SECRETS[@]}"; do
43+
echo "${secret} = \"${{ steps.bitwarden-secrets.outputs[secret] }}\"" >> ./terraform/terraform.tfvars
44+
done
1945
20-
- name: Inspect and Install OpenTofu
21-
run: ./install-opentofu.sh --install-method deb
46+
- name: Configure AWS Credentials
47+
uses: https://github.com/aws-actions/configure-aws-credentials@v2
48+
env:
49+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
50+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2251

23-
- name: Clean up Installer Script
24-
run: rm -f install-opentofu.sh
52+
- name: Setup OpenTofu
53+
uses: https://github.com/opentofu/setup-opentofu@v1
2554

26-
- name: Initialize OpenTofu
55+
- name: Run OpenTofu Init
2756
run: tofu init
28-
working-directory: ./terraform
2957

30-
- name: Apply OpenTofu
31-
run: tofu apply -input=false
32-
working-directory: ./terraform
58+
- name: Run OpenTofu Plan
59+
id: plan
60+
run: tofu plan -no-color
61+
62+
- name: Display Plan Output
63+
run: |
64+
echo "Plan output:"
65+
echo "${{ steps.plan.outputs.stdout }}"
66+
67+
- name: Apply the Plan
68+
if: success()
69+
run: tofu apply -auto-approve

‎docker/whisper/docker-compose.yml

-19
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.