Changeset View
Changeset View
Standalone View
Standalone View
proxmox/terraform/README.md
- This file was added.
# What | |||||
Terraform allows to transparently declare our infrastructure as code. Providing | |||||
a (non-official so far) plugin, we can provision vm the same way for our rocq | |||||
infra (proxmox) | |||||
# The road so far | |||||
## setup.sh | |||||
Create a `setup.sh` file holding the PM_{USER,PASS} information: | |||||
``` | |||||
export PM_USER=<swh-login>@pam | |||||
export PM_PASS=<swh-login-pass> | |||||
``` | |||||
source it in your current shell session. | |||||
``` | |||||
source setup.sh | |||||
``` | |||||
## provision new vm | |||||
``` | |||||
terraform init | |||||
terraform apply | |||||
``` | |||||
# Details | |||||
The provisioning is bootstraping vm declared in ".tf" files. It's using a base | |||||
template (debian-9-template, debian-10-template) installed in the hypervisor. | |||||
Instructions are detailed in the `init-clone.org` file. | |||||
# Init | |||||
This initializes your local copy with the necessary: | |||||
``` | |||||
terraform init | |||||
``` | |||||
# Plan changes | |||||
This will compute all *.tf files present in the folder and compute a | |||||
differential plan: | |||||
``` | |||||
terraform plan | |||||
``` | |||||
Note: It might be a good idea to change the `variables.tf` file to adapt for | |||||
example the admin user and its associated public key | |||||
# Apply changes | |||||
Same as previous command except that it applies the diff to the infra | |||||
(interactively): | |||||
``` | |||||
terraform apply | |||||
``` |