diff --git a/proxmox/templates/debian_bullseye.json b/proxmox/templates/debian_bullseye.json index 541b412..3cbb369 100644 --- a/proxmox/templates/debian_bullseye.json +++ b/proxmox/templates/debian_bullseye.json @@ -1,119 +1,119 @@ { "variables": { "home": "{{ env `HOME` }}", "username": "{{ env `PROXMOX_USER` }}", "password": "{{ env `PROXMOX_PASSWORD` }}", "proxmox_server": "{{ env `PROXMOX_URL` }}", "proxmox_node": "{{env `PROXMOX_NODE` }}", "http_server" : "{{ env `HTTP_SERVER_URL` }}", "ip": "{{ env `TEMPLATE_IP` }}", "netmask": "{{ env `TEMPLATE_NETMASK` }}", "gw": "{{ env `TEMPLATE_GW` }}", "nameserver": "{{ env `TEMPLATE_NS` }}", "template-date": "{{ isotime \"2006-01-02T15:04:05Z\" }}", "template-suffix" : "{{ isotime \"2006-01-02\" }}" }, "sensitive-variables": [ "password" ], "builders": [ { "type": "proxmox", "proxmox_url": "{{ user `proxmox_server` }}", "insecure_skip_tls_verify": true, "username": "{{ user `username` }}", "password": "{{ user `password` }}", "node": "{{ user `proxmox_node` }}", - "vm_id": 10006, + "vm_id": 10007, "memory": 1024, "sockets": "1", "cores": 2, "network_adapters": [ { "bridge": "vmbr0", "model": "virtio" } ], "scsi_controller": "virtio-scsi-pci", "disks": [ { "type": "virtio", "disk_size": "20G", "storage_pool": "proxmox", "storage_pool_type": "cephfs" } ], "qemu_agent": "true", "cloud_init": "true", "cloud_init_storage_pool": "proxmox", - "iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.2.0-amd64-netinst.iso", - "iso_checksum": "45c9feabba213bdc6d72e7469de71ea5aeff73faea6bfb109ab5bad37c3b43bd", + "iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso", + "iso_checksum": "7892981e1da216e79fb3a1536ce5ebab157afdd20048fe458f2ae34fbc26c19b", "iso_storage_pool": "proxmox-cephfs", "unmount_iso": "true", "http_directory": "config", "http_port_min": "8888", "http_port_max": "8888", "boot_wait": "10s", "boot_command": [ "", "install ", "preseed/url={{ user `http_server` }}/preseed.cfg ", "debian-installer=en_US.UTF-8 ", "auto ", "locale=en_US.UTF-8 ", "kbd-chooser/method=us ", "keyboard-configuration/xkb-keymap=us ", "fb=false ", "netcfg/disable_autoconfig=true ", "netcfg/get_hostname=base-template ", "netcfg/get_domain=swh.network ", "netcfg/get_ipaddress={{ user `ip` }} ", "netcfg/get_netmask={{ user `netmask` }} ", "netcfg/get_gateway={{ user `gw` }} ", "netcfg/get_nameservers={{ user `nameserver` }} ", "debconf/frontend=noninteractive ", "DEBCONF_DEBUG=5 ", "console-setup/ask_detect=false ", "console-keymaps-at/keymap=us ", "grub-installer/bootdev=/dev/vda ", "" ], - + "ssh_host": "{{ user `ip` }}", "ssh_username": "installer", "ssh_timeout": "15m", "ssh_password": "installer", - "template_name": "debian-bullseye-11.2-{{ user `template-suffix` }}", + "template_name": "debian-bullseye-11.3-{{ user `template-suffix` }}", "template_description": "debian bullseye, generated on {{ user `template-date` }}" } ], "provisioners": [ { "type": "shell", "expect_disconnect": "false", "execute_command": "echo 'installer'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/post-install.sh" ] }, { "type": "shell", "expect_disconnect": "true", "execute_command": "echo 'installer'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/proxmox.sh" ] }, { "type": "shell", "expect_disconnect": "false", "execute_command": "echo 'installer'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/cleanup.sh" ] } ] } diff --git a/proxmox/templates/scripts/post-install.sh b/proxmox/templates/scripts/post-install.sh index f9d7dce..576babc 100644 --- a/proxmox/templates/scripts/post-install.sh +++ b/proxmox/templates/scripts/post-install.sh @@ -1,25 +1,27 @@ #!/bin/bash -eu #### # apt configuration #### source /etc/os-release cat </etc/apt/sources.list.d/debian.list deb http://deb.debian.org/debian ${VERSION_CODENAME} main deb-src http://deb.debian.org/debian ${VERSION_CODENAME} main deb http://deb.debian.org/debian ${VERSION_CODENAME}-updates main deb-src http://deb.debian.org/debian ${VERSION_CODENAME}-updates main EOF export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y man wget curl telnet net-tools dnsutils traceroute unbound gpg aptitude +apt-get upgrade -y +apt-get install -y man wget curl telnet net-tools dnsutils traceroute unbound \ + gpg aptitude aptitude -y install "?priority(standard)!~i?archive(stable)" #### # Puppet #### apt-get install -y puppet gnupg diff --git a/proxmox/terraform/modules/node/variables.tf b/proxmox/terraform/modules/node/variables.tf index ed49e0d..b156425 100644 --- a/proxmox/terraform/modules/node/variables.tf +++ b/proxmox/terraform/modules/node/variables.tf @@ -1,127 +1,132 @@ variable "hostname" { description = "Node's hostname" type = string } variable "domainname" { description = "Domain name. If empty the config domain is used as fallback." type = string default = "" } variable "description" { description = "Node's description" type = string } variable "hypervisor" { description = "Hypervisor to install the vm to (choice: orsay, hypervisor3, beaubourg, branly)" type = string } variable "template" { - description = "Template created by packer to use (template-debian-10, debian-buster-...)" + description = "Debian image template created by packer" + # Note: use "buster" template for node with swh services (storage, objstorage, ...). + # You can use latest "bullseye" templates otherwise. type = string - default = "debian-buster-2020-11-06" + default = "debian-buster-10.10-2021-09-09" + # other possible template values: + # - debian-bullseye-2022-04-21 + # - debian-bullseye-zfs-2022-04-21 (for extra zfs dependencies) } variable "sockets" { description = "Number of sockets" type = number default = 1 } variable "cores" { description = "Number of cores" type = number default = 1 } variable "memory" { description = "Memory in Mb" type = number default = 1024 } variable "networks" { description = "Default networks configuration (id, ip, gateway, macaddr, bridge)" type = list(object({ id = number ip = string gateway = string macaddr = string bridge = string })) default = [] } variable "vmid" { description = "virtual machine id" type = number default = null } variable "balloon" { description = "ballooning option" type = number default = 0 } variable "numa" { type = bool default = false } variable "storages" { description = "Default disks configuration (storage, size)" type = list(object({ storage = string size = string })) default = [{ storage = "proxmox" size = "32G" }] } variable "config" { description = "Local config to avoid duplication from the main module" type = map(string) } variable "args" { description = "args to pass to the qemu command. should not be used in most cases" type = string default = "" } variable "pre_provision_steps" { description = "List of sequential provisioning steps to apply" type = list(string) default = [] } variable "cicustom" { description = "custom ci parameter" type = string default = "" } variable "full_clone" { description = "Full clone the template" type = bool default = false } variable "cpu" { description = "CPU type possible values (not exhaustive): kvm64, host, ... The default is kvm64 and must be specified to avoid issues on refresh" type = string default = "kvm64" } variable "onboot" { description = "Start the vm on hypervisor boot" type = bool default = true } diff --git a/proxmox/terraform/staging/staging.tf b/proxmox/terraform/staging/staging.tf index 8c87864..c3d3c2a 100644 --- a/proxmox/terraform/staging/staging.tf +++ b/proxmox/terraform/staging/staging.tf @@ -1,472 +1,472 @@ # Keyword use: # - provider: Define the provider(s) # - data: Retrieve data information to be used within the file # - resource: Define resource and create/update # Default configuration passed along module calls # (There is no other way to avoid duplication) locals { config = { dns = var.dns domain = var.domain puppet_environment = var.puppet_environment facter_deployment = "staging" facter_subnet = "sesi_rocquencourt_staging" puppet_master = var.puppet_master gateway_ip = var.gateway_ip user_admin = var.user_admin user_admin_ssh_public_key = var.user_admin_ssh_public_key user_admin_ssh_private_key_path = var.user_admin_ssh_private_key_path } } module "scheduler0" { source = "../modules/node" config = local.config vmid = 116 hostname = "scheduler0" description = "Scheduler api services" hypervisor = "beaubourg" # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" cores = 4 memory = 8192 balloon = 1024 networks = [{ id = 0 ip = "192.168.130.50" gateway = local.config["gateway_ip"] macaddr = "92:02:7E:D0:B9:36" bridge = "vmbr443" }] } output "scheduler0_summary" { value = module.scheduler0.summary } module "worker0" { source = "../modules/node" config = local.config vmid = 117 hostname = "worker0" description = "Loader/lister service node" hypervisor = "beaubourg" cores = "4" memory = "12288" balloon = 1024 # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" onboot = false networks = [{ id = 0 ip = "192.168.130.100" gateway = local.config["gateway_ip"] macaddr = "72:D9:03:46:B1:47" bridge = "vmbr443" }] } output "worker0_summary" { value = module.worker0.summary } module "worker1" { source = "../modules/node" config = local.config vmid = 118 hostname = "worker1" description = "Loader/lister service node" hypervisor = "beaubourg" cores = "4" memory = "12288" balloon = 1024 # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" onboot = false networks = [{ id = 0 ip = "192.168.130.101" gateway = local.config["gateway_ip"] macaddr = "D6:A9:6F:02:E3:66" bridge = "vmbr443" }] } output "worker1_summary" { value = module.worker1.summary } module "worker2" { source = "../modules/node" config = local.config vmid = 112 hostname = "worker2" description = "Loader/lister service node" hypervisor = "branly" cores = 4 memory = 12288 balloon = 1024 onboot = false networks = [{ id = 0 ip = "192.168.130.102" gateway = local.config["gateway_ip"] macaddr = "AA:57:27:51:75:18" bridge = "vmbr443" }] } output "worker2_summary" { value = module.worker2.summary } module "webapp" { source = "../modules/node" config = local.config vmid = 119 hostname = "webapp" description = "Archive/Webapp service node" hypervisor = "branly" cores = 4 memory = 16384 balloon = 1024 # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" networks = [{ id = 0 ip = "192.168.130.30" gateway = local.config["gateway_ip"] macaddr = "1A:00:39:95:D4:5F" bridge = "vmbr443" }] } output "webapp_summary" { value = module.webapp.summary } module "deposit" { source = "../modules/node" config = local.config vmid = 120 hostname = "deposit" description = "Deposit service node" hypervisor = "beaubourg" cores = "4" memory = "8192" balloon = 1024 # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" networks = [{ id = 0 ip = "192.168.130.31" gateway = local.config["gateway_ip"] macaddr = "9E:81:DD:58:15:3B" bridge = "vmbr443" }] } output "deposit_summary" { value = module.deposit.summary } module "vault" { source = "../modules/node" config = local.config vmid = 121 hostname = "vault" description = "Vault services node" hypervisor = "beaubourg" cores = "4" memory = "8192" balloon = 1024 # to match the real vm configuration in proxmox # to remove args = "-device virtio-rng-pci" networks = [{ id = 0 ip = "192.168.130.60" gateway = local.config["gateway_ip"] macaddr = "16:15:1C:79:CB:DB" bridge = "vmbr443" }] } output "vault_summary" { value = module.vault.summary } module "rp0" { source = "../modules/node" config = local.config hypervisor = "branly" vmid = 129 hostname = "rp0" description = "Node to host the reverse proxy" cores = 2 memory = 2048 balloon = 1024 networks = [{ id = 0 ip = "192.168.130.20" gateway = local.config["gateway_ip"] macaddr = "4A:80:47:5D:DF:73" bridge = "vmbr443" }] # facter_subnet = "sesi_rocquencourt_staging" # factor_deployment = "staging" } output "rp0_summary" { value = module.rp0.summary } module "search-esnode0" { source = "../modules/node" config = local.config hypervisor = "branly" vmid = 130 hostname = "search-esnode0" description = "Node to host the elasticsearch instance" cores = "4" memory = "32768" balloon = 9216 networks = [{ id = 0 ip = "192.168.130.80" gateway = local.config["gateway_ip"] macaddr = "96:74:49:BD:B5:08" bridge = "vmbr443" }] storages = [{ id = 0 storage = "proxmox" size = "32G" }, { id = 1 storage = "proxmox" size = "200G" }] } output "search-esnode0_summary" { value = module.search-esnode0.summary } module "search0" { source = "../modules/node" config = local.config hypervisor = "branly" vmid = 131 hostname = "search0" description = "Node to host the swh-search rpc backend service" cores = 2 memory = 4096 balloon = 1024 networks = [{ id = 0 ip = "192.168.130.90" gateway = local.config["gateway_ip"] macaddr = "EE:FA:76:55:CF:99" bridge = "vmbr443" }] } output "search0_summary" { value = module.search0.summary } module "objstorage0" { source = "../modules/node" config = local.config hypervisor = "pompidou" vmid = 102 hostname = "objstorage0" description = "Node to host a read-only objstorage for mirrors" cores = 2 memory = 12288 balloon = 3072 networks = [{ id = 0 ip = "192.168.130.110" gateway = local.config["gateway_ip"] macaddr = "5E:28:EA:7D:50:0D" bridge = "vmbr443" }] } output "objstorage0_summary" { value = module.objstorage0.summary } module "worker3" { source = "../modules/node" config = local.config vmid = 137 hostname = "worker3" description = "Indexer worker" hypervisor = "pompidou" cores = 4 memory = 12288 balloon = 1024 onboot = false networks = [{ id = 0 ip = "192.168.130.103" gateway = local.config["gateway_ip"] macaddr = "1A:F8:1A:2C:12:E1" bridge = "vmbr443" }] } output "worker3_summary" { value = module.worker3.summary } module "counters0" { source = "../modules/node" config = local.config vmid = 138 hostname = "counters0" description = "Counters server" hypervisor = "pompidou" cores = "4" memory = "6096" balloon = 2048 networks = [{ id = 0 ip = "192.168.130.95" gateway = local.config["gateway_ip"] macaddr = "E2:6E:12:C7:3E:A4" bridge = "vmbr443" }] } output "counters0_summary" { value = module.counters0.summary } module "mirror-test" { source = "../modules/node" config = local.config vmid = 132 hostname = "mirror-test" description = "Sandbox VM to test the mirror environment" hypervisor = "uffizi" sockets = "2" cores = "4" memory = "65536" balloon = "20480" networks = [{ id = 0 ip = "192.168.130.160" gateway = local.config["gateway_ip"] macaddr = "E6:3C:8A:B7:26:5D" bridge = "vmbr443" }] } output "mirror-tests_summary" { value = module.mirror-test.summary } module "maven-exporter0" { source = "../modules/node" - template = "debian-bullseye-11.0-2021-09-09" # otherwise to use more recent template + template = "debian-bullseye-11.3-2022-04-21" vmid = 122 config = local.config hostname = "maven-exporter0" description = "Maven index exporter to run containers and expose export.fld files" hypervisor = "pompidou" sockets = "1" cores = "4" onboot = true memory = "4096" balloon = "1024" networks = [{ id = 0 ip = "192.168.130.70" gateway = local.config["gateway_ip"] macaddr = "36:86:F6:F9:2A:5D" bridge = "vmbr443" }] storages = [{ storage = "proxmox" size = "20G" }, { storage = "proxmox" size = "50G" } ] } output "maven-exporter0_summary" { value = module.maven-exporter0.summary } module "scrubber0" { source = "../modules/node" vmid = 142 config = local.config hostname = "scrubber0" description = "Scrubber checker services" hypervisor = "pompidou" sockets = "1" cores = "4" onboot = true memory = "4096" balloon = "1024" networks = [{ id = 0 ip = "192.168.130.120" gateway = local.config["gateway_ip"] macaddr = "86:09:0A:61:AB:C1" bridge = "vmbr443" }] storages = [{ storage = "proxmox" size = "30G" } ] } output "scrubber0_summary" { value = module.scrubber0.summary }