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 (3363B)


      1 provider "libvirt" {
      2   uri = var.libvirt_uri
      3 }
      4 
      5 module "ori_network" {
      6   source = "../../modules/libvirt_network"
      7 
      8   network_bridge_interface = "virbr1"
      9   network_name = "ori_network"
     10   network_cidr = "192.168.144.0/24"
     11   network_dns_enabled = false
     12 }
     13 
     14 resource "libvirt_volume" "base_debian_volume" {
     15   name   = "debian_base_volume"
     16   pool   = var.libvirt_storage_pool
     17   format = "qcow2"
     18   source = "/home/bsd/Disks/packer-debian10-base-v2"
     19 }
     20 
     21 resource "libvirt_volume" "base_openbsd_volume" {
     22   name   = "openbsd_base_volume"
     23   pool   = var.libvirt_storage_pool
     24   format = "qcow2"
     25   source = "/home/bsd/Disks/packer-openbsd6.7-base"
     26 }
     27 
     28 module "dirty_debian_dev" {
     29   source = "../../modules/libvirt_host"
     30 
     31   host_name = "dirty_debian_dev"
     32   host_memory = "1024"
     33   host_vcpu = 2
     34   storage_pool = var.libvirt_storage_pool
     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.ori_network.id
     39   network_cidr = module.ori_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 = "1024"
     53   host_vcpu = 1
     54   storage_pool = var.libvirt_storage_pool
     55   volume_name = "nv_core"
     56   base_volume_id = libvirt_volume.base_debian_volume.id
     57   disks = [{"volume_id": libvirt_volume.base_debian_volume.id}]
     58   network_id = module.ori_network.id
     59   network_cidr = module.ori_network.cidr
     60   network_host = "3"
     61   enable_cloud_init = true
     62   cloudinit_user_template = <<EOF
     63 runcmd:
     64   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
     65 EOF
     66 }
     67 
     68 module "openbsd_67" {
     69   source = "../../modules/libvirt_host"
     70 
     71   host_name = "openbsd67"
     72   host_memory = "512"
     73   host_vcpu = 1
     74   storage_pool = var.libvirt_storage_pool
     75   volume_name = "opnbsd_67"
     76   base_volume_id = libvirt_volume.base_openbsd_volume.id
     77   disks = [{"volume_id": libvirt_volume.base_openbsd_volume.id}]
     78   network_id = module.ori_network.id
     79   network_cidr = module.ori_network.cidr
     80   network_host = "4"
     81   enable_cloud_init = false
     82 }
     83 
     84 module "xorg_enabled" {
     85   source = "../../modules/libvirt_host"
     86 
     87   host_name = "xorg_enabled"
     88   host_memory = "1024"
     89   host_vcpu = 1
     90   storage_pool = var.libvirt_storage_pool
     91   volume_name = "xorg_enabled"
     92   base_volume_id = libvirt_volume.base_debian_volume.id
     93   disks = [{"volume_id": libvirt_volume.base_debian_volume.id}]
     94   network_id = module.ori_network.id
     95   network_cidr = module.ori_network.cidr
     96   network_host = "5"
     97   enable_cloud_init = true
     98   cloudinit_user_template = <<EOF
     99 runcmd:
    100   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
    101 EOF
    102 }
    103 
    104 module "rust_dev" {
    105   source = "../../modules/libvirt_host"
    106 
    107   host_name = "rust_dev"
    108   host_memory = "1024"
    109   host_vcpu = 2
    110   storage_pool = var.libvirt_storage_pool
    111   volume_name = "rust_dev"
    112   base_volume_id = libvirt_volume.base_debian_volume.id
    113   disks = [{"volume_id": libvirt_volume.base_debian_volume.id}]
    114   network_id = module.ori_network.id
    115   network_cidr = module.ori_network.cidr
    116   network_host = "7"
    117   enable_cloud_init = true
    118   cloudinit_user_template = <<EOF
    119 runcmd:
    120   - echo 'source /etc/network/interfaces.d/*' > /etc/network/interfaces
    121 EOF
    122 }