ravecat

main.yml

Dec 14th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. terraform {
  2. required_providers {
  3. proxmox = {
  4. source = "Telmate/proxmox"
  5. # Use current source in case of unstable work provider from registory
  6. # Image with preinstalled provider available here https://gitlab.com/groups/rvct/-/container_registries/1562601
  7. # source = "registry.local/telmate/proxmox"
  8. version = ">=2.0.0"
  9. }
  10. }
  11.  
  12. backend "s3" {
  13. bucket = "inf-state"
  14. key = "terraform.tfstate"
  15. encrypt = true
  16. dynamodb_table = "infra-state-lock"
  17. }
  18. }
  19.  
  20. provider "proxmox" {
  21. pm_user = var.pm_user
  22. pm_password = var.pm_password
  23. pm_api_url = var.pm_api_url
  24. pm_tls_insecure = true
  25. }
  26.  
  27. resource "proxmox_vm_qemu" "gate" {
  28. count = 1
  29. name = "gate"
  30. target_node = "node-0"
  31. clone = "debian-10-cloudinit"
  32. os_type = "cloud-init"
  33. cores = 4
  34. sockets = "1"
  35. cpu = "host"
  36. memory = 4096
  37. scsihw = "virtio-scsi-pci"
  38. bootdisk = "scsi0"
  39.  
  40. disk {
  41. size = "200G"
  42. type = "scsi"
  43. storage = "local-lvm"
  44. iothread = true
  45. }
  46.  
  47. network {
  48. model = "virtio"
  49. bridge = "vmbr0"
  50. }
  51.  
  52. sshkeys = <<EOF
  53. ${var.ssh_key}
  54. EOF
  55.  
  56. ciuser = "test"
  57. cipassword = "test"
  58.  
  59. ipconfig0 = "ip=dhcp"
  60.  
  61. lifecycle {
  62. ignore_changes = [
  63. network
  64. ]
  65. }
  66. }
  67.  
  68. output "test" {
  69. value = proxmox_vm_qemu.gate
  70. }
Advertisement
Add Comment
Please, Sign In to add comment