Changeset View
Changeset View
Standalone View
Standalone View
proxmox/terraform/README.md
# What | # What | ||||
Terraform allows to transparently declare our infrastructure as code. Providing | 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 | a (non-official so far) plugin, we can provision vm the same way for our rocq | ||||
infra (proxmox) | infra (proxmox) | ||||
# The road so far | |||||
## Prepare workstation | ## Prepare workstation | ||||
See prepare-workstation.md | See prepare-workstation.md | ||||
## setup.sh | ## setup.sh | ||||
Create a `setup.sh` file holding the PM_{USER,PASS} information: | Create a `setup.sh` file holding the PM_{USER,PASS} information: | ||||
``` | ``` | ||||
export PM_USER=<swh-login>@pam | export PM_USER=<swh-login>@pam | ||||
export PM_PASS=<swh-login-pass> | export PM_PASS=<swh-login-pass> | ||||
``` | ``` | ||||
source it in your current shell session. | source it in your current shell session. | ||||
``` | ``` | ||||
source setup.sh | source setup.sh | ||||
``` | ``` | ||||
## provision new vm | ## provision infra | ||||
``` | ``` | ||||
terraform init | terraform init | ||||
terraform apply | terraform apply | ||||
``` | ``` | ||||
# Details | # Details | ||||
The provisioning is bootstraping vm declared in ".tf" files. It's using a base | The provisioning is bootstraping vms declared in ".tf" files (in dependency | ||||
template (debian-9-template, debian-10-template) installed in the hypervisor. | order if any). | ||||
Instructions are detailed in the `init-template.md` file. | |||||
It's using a base template (either debian-9-template, debian-10-template) | |||||
installed in the hypervisor. Instructions are detailed in the | |||||
`init-template.md` file. | |||||
# Init | ## Init | ||||
This initializes your local copy with the necessary: | This initializes your local copy with the necessary: | ||||
``` | ``` | ||||
terraform init | terraform init | ||||
``` | ``` | ||||
# Plan changes | ## Plan changes | ||||
Compulse all *.tf files present in the folder, then compute a | Parse all *.tf files present in the folder, then compute a differential plan: | ||||
differential plan: | |||||
``` | ``` | ||||
terraform plan | terraform plan | ||||
``` | ``` | ||||
# Apply changes | ## Apply changes | ||||
Propose to apply the plan to the infra (interactively): | Propose to apply the plan to the infra (interactively): | ||||
``` | ``` | ||||
terraform apply | terraform apply | ||||
``` | ``` |