Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,23 @@ jobs:
shell: bash
env:
TF_IN_AUTOMATION: "true"
TF_VAR_admin_cidr: ${{ secrets.ADMIN_CIDR }}
TF_VAR_ssh_key_name: ${{ vars.SSH_KEY_NAME }}
run: |
set -euo pipefail
: "${TF_VAR_admin_cidr:?Missing ADMIN_CIDR secret}"
: "${TF_VAR_ssh_key_name:?Missing SSH_KEY_NAME variable}"
test -f environments/test/network/deployment.tfvars
test -f environments/test/frontend/deployment.tfvars
for STACK in network frontend; do
echo "::group::TEST $STACK plan"
set +e
tofu -chdir="environments/test/$STACK" plan \
-var-file="deployment.tfvars" \
-input=false \
-no-color \
-lock-timeout=5m \
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ crash.*.log
*.tfvars
*.tfvars.json

# Allow version-controlled deployment configurations
!**/deployment.tfvars

# Plans
*.tfplan
tfplan
Expand Down
9 changes: 9 additions & 0 deletions environments/test/frontend/deployment.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
frontend_name = "assignment2-test-frontend"
frontend_count = 1

frontend_image = "Debian 13 (Trixie) stable amd64"
frontend_flavor = "gx1.1c1r"

http_cidr = "0.0.0.0/0"

external_network_name = "ntnu-internal"
13 changes: 13 additions & 0 deletions environments/test/network/deployment.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
network_name = "assignment2-test-network"

frontend_subnet_name = "test-frontend-subnet"
frontend_subnet_cidr = "10.60.10.0/24"

backend_subnet_name = "test-backend-subnet"
backend_subnet_cidr = "10.60.20.0/24"

database_subnet_name = "test-database-subnet"
database_subnet_cidr = "10.60.30.0/24"

router_name = "assignment2-test-router"
external_network_name = "ntnu-internal"