The terraform
source code, takes a template, builds a VM from it and then runs ansible to configure it futher.
- Ansible
- Terraform
cd terraform/qemu
terraform apply \
--auto-approve=true \
--var-file="../os_tfvars/rocky/rocky-8-x86.tfvars"
cd ../../
OR
./tf.sh -a=apply # default is qemu rocky 8 x86_64
cd terraform/qemu
terraform apply \
--auto-approve=true \
--var-file="../os_tfvars/rocky/rocky-8-aarch64.tfvars"
cd ../../
OR
./tf.sh -a=apply --os-arch="aarch64"
For destroying its basically all the same other than the folder you are going to run the destroy in. Since we have different providers/vendors you need to change directory into the providers/vendors folder to be able to destroy it.
cd terraform/qemu
terraform destroy --auto-approve=true
cd ../../
OR
./tf.sh -a=destroy # default vendor is qemu