Based on https://github.com/andreilapkin/tf-pve-k8s
One of the tasks of the Terraform script is to automatically create an inventory file for later launching Ansible playbooks. This is the main problem.
The Terraform provider Telmate/proxmox uses the ssh_host
attribute to determine the IP address of instances.
- Copy content of run_on_pve folder to Proxmov VE
- Copy your public SSH key file to Proxmox VE and remember name and location (i.e.,
/root/user.pub
) - Login in to Proxmox VE and execute one or more copied script after configure setting it's settings:
will be added later
- Install Terraform on your computer
- Configure
env.tfvars.example
file and rename it toenv.tfvars
- Configure files
provider.tf
,terraform.tf
if necessary. - Run for initialize Terraform:
terraform init -var-file env.tfvars
- Run to plan:
terraform plan -var-file env.tfvars
- Run to deploy:
terraform apply -var-file env.tfvars
If you have slow SATA HDD and give errors about filelock, run deploy with only one executor:
terraform apply -var-file env.tfvars -parallelism=1
- Run to destroy:
terraform destroy -var-file env.tfvars