The example configuration creates one VPS with remote-exec
provisioner
and deploys a public key.
The provider needs an authentication token to the vpsAdmin API. The token can be obtained using any of HaveAPI clients, but the provider also comes with a simple CLI utility get-token.
For this example, the token should be put in an arbitrary tfvars file, e.g.
token.auto.tfvars
:
vpsadmin_token = "your token"
Edit main.tf
and set up your public key for deployment and private key
for provisioner.
$ terraform init
$ terraform plan
$ terraform apply
In case you have more than one VPS, please apply with -parallelism=1
:
$ terraform apply -parallelism=1