diff --git a/README.md b/README.md index 9157255..6e62916 100644 --- a/README.md +++ b/README.md @@ -7,59 +7,76 @@ terraform module for creating proxmox vms
CREATE PVE VM ```hcl -provider "proxmox" { - pm_api_url = var.pve_api_url - pm_user = var.pve_api_user - pm_password = var.pve_api_password - pm_tls_insecure = var.pve_api_tls_verify -} - +# CALL MODULE - main.tf +# main.tf module "proxmox-vm" { source = "git::https://github.com/stuttgart-things/proxmox-vm.git" + pve_api_url = var.pve_api_url + pve_api_user = var.pve_api_user + pve_api_password = var.pve_api_password + pve_api_tls_verify = var.pve_api_tls_verify + pve_cluster_node = "sthings-pve1" pve_datastore = "datastore" pve_folder_path = "stuttgart-things" - pve_network = "vmbr0" + pve_network = "vmbr101" vm_count = 1 - vm_name = "cstream8-test" - vm_notes = "cstream8-blal" - vm_template = "cstream8" + vm_name = "vm-test-name" + vm_notes = "vm-info" + vm_template = "ubuntu22" vm_num_cpus = "4" vm_memory = "4096" - vm_disk_size = "35G" + vm_disk_size = "32G" + vm_ssh_user = var.vm_ssh_user + vm_ssh_password = var.vm_ssh_password } output "ip" { - value = module.proxmox.ip + value = module.proxmox-vm.ip } output "mac" { - value = module.proxmox.mac + value = module.proxmox-vm.mac } output "id" { - value = module.proxmox.id + value = module.proxmox-vm.id } + variable "pve_api_url" { - default = "https://sthings-pve1.example.com:8006/api2/json" description = "url of proxmox api" } - + variable "pve_api_user" { - default = "terraform@pve" description = "username of proxmox api user" } - + variable "pve_api_password" { - default = "{{ your_password}}" description = "password of proxmox api user" } - + +variable "vm_ssh_user" { + description = "username of proxmox api user" +} + +variable "vm_ssh_password" { + description = "password of proxmox api user" +} + variable "pve_api_tls_verify" { - default = true description = "proxmox API disable check if cert is valid" } + ``` + +``` +# VARIABLES -tfvars +pve_api_url="" #Example: "https://server-example.sva.de:8006/api2/json" +pve_api_user="" +pve_api_password="" +pve_api_tls_verify = true +vm_ssh_user="" +vm_ssh_password="" ```