Changeset View
Changeset View
Standalone View
Standalone View
proxmox/terraform/staging/staging.tf
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | lifecycle { | ||||
ignore_changes = [ | ignore_changes = [ | ||||
bootdisk, | bootdisk, | ||||
scsihw, | scsihw, | ||||
target_node | target_node | ||||
] | ] | ||||
} | } | ||||
} | } | ||||
# Define the staging network gateway | module "storage0" { | ||||
# FIXME: Find a way to reuse the module "node" | source = "../modules/node" | ||||
# Main difference between node in module and this: | config = local.config | ||||
# - storage0 define 2 disks | hypervisor = "orsay" | ||||
resource "proxmox_vm_qemu" "storage0" { | |||||
name = "storage0" | |||||
desc = "swh storage services" | |||||
# hypervisor onto which make the vm | |||||
target_node = "orsay" | |||||
vmid = 114 | vmid = 114 | ||||
full_clone = false | hostname = "storage0" | ||||
description = "swh storage services" | |||||
# See init-template.md to see the template vm bootstrap | cores = "4" | ||||
clone = "template-debian-10" | memory = "8192" | ||||
# linux kernel 2.6 | |||||
qemu_os = "l26" | |||||
# generic setup | |||||
sockets = 1 | |||||
cores = 4 | |||||
memory = 8192 | |||||
balloon = 1024 | balloon = 1024 | ||||
network = { | |||||
boot = "c" | ip = "192.168.128.2" | ||||
macaddr = "CA:73:7F:ED:F9:01" | |||||
# boot machine when hypervirsor starts | bridge = "vmbr443" | ||||
onboot = true | } | ||||
storages = [{ | |||||
#### cloud-init setup | |||||
# to actually set some information per os_type (values: ubuntu, centos, | |||||
# cloud-init). Keep this as cloud-init | |||||
os_type = "cloud-init" | |||||
# ciuser - User name to change ssh keys and password for instead of the | |||||
# image’s configured default user. | |||||
ciuser = var.user_admin | |||||
ssh_user = var.user_admin | |||||
# searchdomain - Sets DNS search domains for a container. | |||||
searchdomain = var.domain | |||||
# nameserver - Sets DNS server IP address for a container. | |||||
nameserver = var.dns | |||||
# sshkeys - public ssh keys, one per line | |||||
sshkeys = var.user_admin_ssh_public_key | |||||
# ip to communicate for now with the prod network through louvre | |||||
ipconfig0 = "ip=192.168.128.2/24,gw=192.168.128.1" | |||||
disk { | |||||
id = 0 | id = 0 | ||||
type = "virtio" | |||||
storage = "orsay-ssd-2018" | storage = "orsay-ssd-2018" | ||||
storage_type = "ssd" | |||||
size = "32G" | size = "32G" | ||||
} | }, { | ||||
disk { | |||||
id = 1 | id = 1 | ||||
type = "virtio" | |||||
storage = "orsay-ssd-2018" | storage = "orsay-ssd-2018" | ||||
storage_type = "ssd" | |||||
size = "512G" | size = "512G" | ||||
} | }] | ||||
network { | |||||
id = 0 | |||||
model = "virtio" | |||||
bridge = "vmbr443" | |||||
macaddr = "CA:73:7F:ED:F9:01" | |||||
} | |||||
# Delegate to puppet at the end of the provisioning the software setup | |||||
provisioner "remote-exec" { | |||||
inline = [ | |||||
"sed -i 's/127.0.1.1/192.168.128.2}/g' /etc/hosts", | |||||
"puppet agent --server ${var.puppet_master} --environment=${var.puppet_environment} --waitforcert 60 --test || echo 'Node provisionned!'", | |||||
] | |||||
connection { | |||||
type = "ssh" | |||||
user = "root" | |||||
host = "192.168.128.2" | |||||
} | |||||
} | |||||
lifecycle { | |||||
ignore_changes = [ | |||||
bootdisk, | |||||
scsihw, | |||||
target_node | |||||
] | |||||
} | |||||
} | } | ||||
module "db0" { | module "db0" { | ||||
source = "../modules/node" | source = "../modules/node" | ||||
config = local.config | config = local.config | ||||
hypervisor = "orsay" | hypervisor = "orsay" | ||||
vmid = 115 | vmid = 115 | ||||
hostname = "db0" | hostname = "db0" | ||||
description = "Node to host storage/indexer/scheduler dbs" | description = "Node to host storage/indexer/scheduler dbs" | ||||
cores = "4" | cores = "4" | ||||
memory = "16384" | memory = "16384" | ||||
balloon = 1024 | balloon = 1024 | ||||
network = { | network = { | ||||
ip = "192.168.128.3" | ip = "192.168.128.3" | ||||
macaddr = "3A:65:31:7C:24:17" | macaddr = "3A:65:31:7C:24:17" | ||||
bridge = "vmbr443" | bridge = "vmbr443" | ||||
} | } | ||||
storage = { | storages = [{ | ||||
location = "orsay-ssd-2018" | id = 0 | ||||
storage = "orsay-ssd-2018" | |||||
size = "400G" | size = "400G" | ||||
} | }] | ||||
} | } | ||||
output "db0_summary" { | output "db0_summary" { | ||||
value = module.db0.summary | value = module.db0.summary | ||||
} | } | ||||
module "scheduler0" { | module "scheduler0" { | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |