Adding vm definition
This commit is contained in:
parent
f4dc2409dd
commit
fa4724f6b1
|
@ -0,0 +1,46 @@
|
|||
virtual_machines = {
|
||||
amon = {
|
||||
fqdn = "amon.fabrica.local",
|
||||
domain = "fabrica.local",
|
||||
create_dns_a_record = "no",
|
||||
cpu = 0.4,
|
||||
vcpu = 4,
|
||||
memory = 4096,
|
||||
network_interfaces = [
|
||||
{ network_name = "internet", ip = "192.168.1.3" },
|
||||
{ network_name = "office", ip = "192.168.10.254" }
|
||||
],
|
||||
|
||||
labels = "Production, Amon, Infra, Backup, EOLE"
|
||||
|
||||
disks = {
|
||||
system = {
|
||||
name = "prod-amon-static",
|
||||
source = "http://localhost/fabrica/infra/production/amon.fabrica.local/system/amon.fabrica.local"
|
||||
}
|
||||
]
|
||||
|
||||
depends = [ opennebula_virtual_network.production.id ]
|
||||
},
|
||||
scribe = {
|
||||
fqdn = "scribe.fabrica.local",
|
||||
domain = "fabrica.local",
|
||||
create_dns_a_record = "no",
|
||||
cpu = 0.4,
|
||||
vcpu = 4,
|
||||
memory = 4096,
|
||||
network_interfaces = [
|
||||
{ network_name = "office", ip = "192.168.10.200" }
|
||||
],
|
||||
|
||||
labels = "Production, Scribe, Infra, Backup, EOLE"
|
||||
|
||||
disks = {
|
||||
system = {
|
||||
name = "prod-scribe-static",
|
||||
source = "http://localhost/fabrica/infra/production/scribe.fabrica.local/system/scribe.fabrica.local"
|
||||
}
|
||||
]
|
||||
|
||||
depends = [ opennebula_virtual_network.production.id ]
|
||||
},
|
|
@ -45,38 +45,30 @@ resource "opennebula_virtual_network" "vnet"{
|
|||
*/
|
||||
|
||||
// Production
|
||||
|
||||
/* Amon
|
||||
module "amon" {
|
||||
module "vms" {
|
||||
source = "./modules/virtualMachine"
|
||||
one_user = var.one_user
|
||||
one_prod_ds = var.one_prod_ds
|
||||
for_each = var.virtual_machines
|
||||
|
||||
vm_shortname = "amon"
|
||||
vm_fqdn = "amon.ber.asso.fr"
|
||||
vm_shortname = each.key
|
||||
vm_fqdn = each.value.fqdn
|
||||
vm_domain = var.dns_domain
|
||||
dns_a_record = "no"
|
||||
dns_a_record = each.value.create_dns_a_record
|
||||
|
||||
cpu = 0.4
|
||||
vcpu = 4
|
||||
ram = 4096
|
||||
network_interfaces = [
|
||||
{ network_id = opennebula_virtual_network.internet.id, ip = "192.168.1.2"},
|
||||
{ network_id = opennebula_virtual_network.production.id, ip = "192.168.5.254"},
|
||||
{ network_id = opennebula_virtual_network.office.id, ip = "192.168.10.254"},
|
||||
]
|
||||
cpu = each.value.cpu
|
||||
vcpu = each.value.vcpu
|
||||
ram = each.value.memory
|
||||
network_interfaces = each.value.network_interfaces
|
||||
tag_labels = each.value.labels
|
||||
|
||||
tag_labels = "Production,Infrastructure,Amon,Firewall,EOLE"
|
||||
|
||||
system_image_name = "PROD-AMON-STATIC"
|
||||
system_image_name = each.value.disks.system.name
|
||||
data_image_name = ""
|
||||
|
||||
system_image_source = "http://hapy-ber.ber.asso.fr/factory/ber/production/amon.ber.asso.fr/system/amon.ber.asso.fr_latest.img"
|
||||
system_image_source = each.value.disks.system.source
|
||||
data_image_source = ""
|
||||
|
||||
depends = [
|
||||
opennebula_virtual_network.production.id
|
||||
]
|
||||
depends = each.value.depends
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -74,3 +74,9 @@ variable "virtual_networks" {
|
|||
type = map
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "virtual_machines" {
|
||||
description = "OpenNebula virtual machines definition"
|
||||
type = map
|
||||
default = {}
|
||||
}
|
Loading…
Reference in New Issue