Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva authored Jan 22, 2024
1 parent faf5344 commit f584b26
Showing 1 changed file with 67 additions and 7 deletions.
74 changes: 67 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

terraform for creating proxmox vms

## EXAMPLE USAGE
## EXAMPLE USAGE TERRAFORM

<details><summary><b>CREATE PVE VM</b></summary>

Expand Down Expand Up @@ -67,18 +67,78 @@ variable "pve_api_tls_verify" {
<details><summary><b>EXECUTION</b></summary>

```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
</details>

## EXAMPLE USAGE CROSSPLANE

<details><summary><b>TFVARS (SECRETS)</b></summary>

```hcl
pve_api_url="<API-URL>"
pve_api_user="<API-USER>"
pve_api_password="<API-PASSWORD>"
vm_ssh_user="<SSH-USER>"
vm_ssh_password="<SSH-PASSWORD>"
```

```bash
# To delete the tf managed ressources run destroy
terraform destroy
kubectl create secret generic pve-tfvars --from-file=terraform.tfvars
```

</details>


<details><summary><b>WORKSPACE</b></summary>

```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
```
</details>
Expand Down

0 comments on commit f584b26

Please sign in to comment.