ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

main.tf (2808B)


      1 provider "libvirt" {
      2   uri = var.libvirt_uri
      3 }
      4 
      5 module "lenny_network" {
      6   source = "../../modules/libvirt_network"
      7 
      8   network_bridge_interface = "virbr1"
      9   network_name             = "lenny_network"
     10   network_cidr             = ["192.168.134.0/24"]
     11   network_dns_enabled      = false
     12 }
     13 
     14 resource "libvirt_volume" "base_debian_volume" {
     15   name   = "debian_base_volume"
     16   pool   = libvirt_pool.disk_pool.name
     17   format = "qcow2"
     18   source = "/home/tp/Disks/packer-debian10-base-v2"
     19 }
     20 
     21 resource "libvirt_pool" "disk_pool" {
     22   name = "tf_pool"
     23   type = "dir"
     24   path = "/data/Disks"
     25 }
     26 
     27 module "dirty_debian_dev" {
     28   source = "../../modules/libvirt_host"
     29 
     30   host_name               = "dirty_debian_dev"
     31   host_memory             = "512"
     32   host_vcpu               = 1
     33   host_autostart          = false
     34   storage_pool            = libvirt_pool.disk_pool.name
     35   volume_name             = "dirty_debian_dev"
     36   base_volume_id          = libvirt_volume.base_debian_volume.id
     37   disks                   = [{ "volume_id" : libvirt_volume.base_debian_volume.id }]
     38   network_id              = module.lenny_network.id
     39   network_cidr            = module.lenny_network.cidr
     40   network_host            = "2"
     41   enable_cloud_init       = true
     42   cloudinit_user_template = <<EOF
     43 runcmd:
     44   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
     45 EOF
     46 }
     47 
     48 module "nv_core" {
     49   source = "../../modules/libvirt_host"
     50 
     51   host_name               = "nc_core"
     52   host_memory             = "512"
     53   host_vcpu               = 1
     54   host_autostart          = false
     55   storage_pool            = libvirt_pool.disk_pool.name
     56   volume_name             = "nv_core"
     57   base_volume_id          = libvirt_volume.base_debian_volume.id
     58   disks                   = [{ "volume_id" : libvirt_volume.base_debian_volume.id }]
     59   network_id              = module.lenny_network.id
     60   network_cidr            = module.lenny_network.cidr
     61   network_host            = "3"
     62   enable_cloud_init       = true
     63   cloudinit_user_template = <<EOF
     64 runcmd:
     65   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
     66 EOF
     67 }
     68 
     69 module "tor_proxy" {
     70   source = "../../modules/libvirt_host"
     71 
     72   host_name               = "tor_proxy"
     73   host_memory             = "256"
     74   host_vcpu               = 1
     75   host_autostart          = false
     76   storage_pool            = libvirt_pool.disk_pool.name
     77   volume_name             = "tor_proxy"
     78   base_volume_id          = libvirt_volume.base_debian_volume.id
     79   disks                   = [{ "volume_id" : libvirt_volume.base_debian_volume.id }]
     80   network_id              = module.lenny_network.id
     81   network_cidr            = module.lenny_network.cidr
     82   network_host            = "4"
     83   enable_cloud_init       = true
     84   cloudinit_user_template = <<EOF
     85 runcmd:
     86   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
     87 EOF
     88 }