Difference between revisions of "Terraform Libvirt provider"

From wikieduonline
Jump to navigation Jump to search
(Created page with " <pre> terraform { required_version = ">= 0.13" required_providers { libvirt = { source = "dmacvicar/libvirt" version = "0.6.3" } } }...")
 
Line 1: Line 1:
  
 
+
terraform {
 
+
  required_version = ">= 0.13"
<pre>
+
    required_providers {
terraform {
+
      libvirt = {
  required_version = ">= 0.13"
+
        source  = "dmacvicar/libvirt"
    required_providers {
+
        version = "0.6.3"
      libvirt = {
+
      }
        source  = "dmacvicar/libvirt"
+
    }
        version = "0.6.3"
+
}
      }
+
    }
+
provider "[[libvirt]]" {
}
+
  uri = "qemu+ssh://[email protected]/system"
 
+
}
provider "libvirt" {
+
  uri = "qemu+ssh://[email protected]/system"
+
module "vm" {
}
+
  source  = "MonolithProjects/vm/libvirt"
 
+
  version = "1.6.0"  
module "vm" {
+
  source  = "MonolithProjects/vm/libvirt"
+
  vm_hostname_prefix = "server"
  version = "1.6.0"
+
  vm_count    = 3
 
+
  memory      = "2048"
  vm_hostname_prefix = "server"
+
  hugepages  = false
  vm_count    = 3
+
  vcpu        = 1
  memory      = "2048"
+
  pool        = "terra_pool"
  hugepages  = false
+
  system_volume = 20
  vcpu        = 1
+
  pool        = "terra_pool"
+
  dhcp        = true  
  system_volume = 20
+
 
+
  local_admin = "local-admin"
  dhcp        = true
+
  ssh_admin  = "ci-user"
 
+
  ssh_private_key = "~/.ssh/id_ed25519"
  local_admin = "local-admin"
+
  local_admin_passwd = "$6$rounds=4096$xxxxxxxxHASHEDxxxPASSWORD"
  ssh_admin  = "ci-user"
+
  ssh_keys    = [  
  ssh_private_key = "~/.ssh/id_ed25519"
+
    "ssh-ed25519 AAAAxxxxxxxxxxxxSSHxxxKEY example",  
  local_admin_passwd = "$6$rounds=4096$xxxxxxxxHASHEDxxxPASSWORD"
+
    ]
  ssh_keys    = [  
+
  time_zone  = "CET"
    "ssh-ed25519 AAAAxxxxxxxxxxxxSSHxxxKEY example",  
+
  os_img_url  = "file:///home/myuser/ubuntu-20.04-server-cloudimg-amd64.img"
    ]
+
}
  time_zone  = "CET"
+
  os_img_url  = "file:///home/myuser/ubuntu-20.04-server-cloudimg-amd64.img"
+
output "ip_addresses" {
}
+
  value = module.nodes
 
+
}
output "ip_addresses" {
 
  value = module.nodes
 
}
 
 
 
</pre>
 
  
 
== See also ==
 
== See also ==

Revision as of 10:51, 10 April 2021

terraform {
  required_version = ">= 0.13"
    required_providers {
      libvirt = {
        source  = "dmacvicar/libvirt"
        version = "0.6.3"
      }
    }
}

provider "libvirt" {
  uri = "qemu+ssh://[email protected]/system"
}

module "vm" {
  source  = "MonolithProjects/vm/libvirt"
  version = "1.6.0" 

  vm_hostname_prefix = "server"
  vm_count    = 3
  memory      = "2048"
  hugepages   = false
  vcpu        = 1
  pool        = "terra_pool"
  system_volume = 20

  dhcp        = true 

  local_admin = "local-admin"
  ssh_admin   = "ci-user"
  ssh_private_key = "~/.ssh/id_ed25519"
  local_admin_passwd = "$6$rounds=4096$xxxxxxxxHASHEDxxxPASSWORD"
  ssh_keys    = [ 
    "ssh-ed25519 AAAAxxxxxxxxxxxxSSHxxxKEY example", 
    ]
  time_zone   = "CET"
  os_img_url  = "file:///home/myuser/ubuntu-20.04-server-cloudimg-amd64.img"
}

output "ip_addresses" {
  value = module.nodes
}

See also

Advertising: