OpenTofu configuration for deploying infrastructure on SWITCHengines via OpenStack.
├── main.tf # Root configuration
├── variables.tf # Root variables
├── outputs.tf # Root outputs
└── modules/
├── networking/ # Security groups, ports, floating IPs
├── compute/ # Compute instances
├── storage/ # Block storage volumes
└── cloud-init/ # Cloud-init configuration
Copy and configure OpenStack credentials:
cp clouds.example.yaml ~/.config/openstack/clouds.yamlEdit the file with credentials.
Copy and configure variables:
cp /examples/terraform.example.tfvars terraform.tfvarsEdit terraform.tfvars to customize the setup.
Install and authenticate with GitLab CLI:
glab auth loginSelect GitLab FHNW instance when prompted.
glab opentofu init -R 'spd/module/pcls/hs25/hs25-group06/iac-infra' 'default'This automatically configures the remote state backend using your GitLab credentials.
tofu plan # Show planned changes
tofu apply # Apply changes
tofu destroy # Destroy infrastructureThis IaC setup provisions only the infrastructure for the application. The infrastructure includes:
- Compute: Creates the instance
- Networking: Configures security groups, network ports, and floating IPs.
- Storage: Provisions block storage volumes for persistent data
- Cloud-init Configuration: Sets up users, base packages and mounts volume
The application itself is deployed and managed separately using Ansible.