From f584b263683f5a4cd363db35df7b6d22214513f3 Mon Sep 17 00:00:00 2001 From: patrick hermann <47567770+patrick-hermann-sva@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:14:19 +0100 Subject: [PATCH] Update README.md --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a2c2be8..62ac6d4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ terraform for creating proxmox vms -## EXAMPLE USAGE +## EXAMPLE USAGE TERRAFORM
CREATE PVE VM @@ -67,18 +67,78 @@ variable "pve_api_tls_verify" {
EXECUTION ```bash -# Run terraform init to download the module and provider terraform init +terraform apply +terraform destroy ``` -```bash -# Apply to create the tf ressources in proxmox -terraform apply +
+ +## EXAMPLE USAGE CROSSPLANE + +
TFVARS (SECRETS) + +```hcl +pve_api_url="" +pve_api_user="" +pve_api_password="" +vm_ssh_user="" +vm_ssh_password="" ``` ```bash -# To delete the tf managed ressources run destroy -terraform destroy +kubectl create secret generic pve-tfvars --from-file=terraform.tfvars +``` + +
+ + +
WORKSPACE + +```yaml +--- +apiVersion: tf.upbound.io/v1beta1 +kind: Workspace +metadata: + name: appserver + annotations: + crossplane.io/external-name: pve-vm +spec: + providerConfigRef: + name: terraform-default + forProvider: + source: Remote + module: git::https://github.com/stuttgart-things/proxmox-vm.git?ref=v2.9.14-1.5.5 + vars: + - key: vm_count + value: "1" + - key: vm_num_cpus + value: "4" + - key: vm_memory + value: "4096" + - key: vm_name + value: appserver + - key: vm_template + value: ubuntu22 + - key: pve_network + value: vmbr103 + - key: pve_datastore + value: v3700 + - key: vm_disk_size + value: 128G + - key: pve_folder_path + value: stuttgart-things + - key: pve_cluster_node + value: sthings-pve1 + varFiles: + - source: SecretKey + secretKeyRef: + namespace: default + name: pve-tfvars + key: terraform.tfvars + writeConnectionSecretToRef: + namespace: default + name: terraform-workspace-appserver ```