ravecat

main.tf

Nov 28th, 2020 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. terraform {
  2. required_providers {
  3. proxmox = {
  4. source = "Telmate/proxmox"
  5. version = ">=2.0.0"
  6. }
  7. }
  8.  
  9. backend "s3" {
  10. bucket = "infr-state"
  11. key = "terraform.tfstate"
  12. encrypt = true
  13. dynamodb_table = "infra-state-lock"
  14. }
  15. }
  16.  
  17. provider "proxmox" {
  18. pm_user = var.pm_user
  19. pm_password = var.pm_password
  20. pm_api_url = var.pm_api_url
  21. pm_tls_insecure = true
  22. }
  23.  
  24. resource "proxmox_vm_qemu" "vm" {
  25. count = 1
  26. name = "vm-${count.index}"
  27. target_node = "node-0"
  28. clone = "debian-10-cloudinit"
  29. os_type = "cloud-init"
  30. cores = 4
  31. sockets = "1"
  32. cpu = "host"
  33. memory = 4096
  34. scsihw = "virtio-scsi-pci"
  35. bootdisk = "scsi0"
  36.  
  37. disk {
  38. size = "150G"
  39. type = "scsi"
  40. storage = "local-lvm"
  41. iothread = true
  42. }
  43.  
  44. network {
  45. model = "virtio"
  46. bridge = "vmbr0"
  47. }
  48.  
  49. lifecycle {
  50. ignore_changes = [
  51. network
  52. ]
  53. }
  54.  
  55. ipconfig0 = "ip=192.168.88.110/24,gw=192.168.88.1"
  56.  
  57. sshkeys = <<EOF
  58. ${var.template_ssh_key}
  59. EOF
  60. }
Add Comment
Please, Sign In to add comment