diff --git a/proxmox/templates/config/buster-preseed.cfg b/proxmox/templates/config/preseed.cfg similarity index 100% rename from proxmox/templates/config/buster-preseed.cfg rename to proxmox/templates/config/preseed.cfg diff --git a/proxmox/templates/debian_buster.json b/proxmox/templates/debian_bullseye.json similarity index 87% copy from proxmox/templates/debian_buster.json copy to proxmox/templates/debian_bullseye.json index a9caaf0..069031c 100644 --- a/proxmox/templates/debian_buster.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": 10004, + "vm_id": 10005, "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/cdimage/archive/10.10.0/amd64/iso-cd/debian-10.10.0-amd64-netinst.iso", - "iso_checksum": "c433254a7c5b5b9e6a05f9e1379a0bd6ab3323f89b56537b684b6d1bd1f8b6ad", + "iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.0.0-amd64-netinst.iso", + "iso_checksum": "ae6d563d2444665316901fe7091059ac34b8f67ba30f9159f7cef7d2fdc5bf8a", "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` }}/buster-preseed.cfg ", + "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-buster-10.10-{{ user `template-suffix` }}", - "template_description": "debian buster, generated on {{ user `template-date` }}" + "template_name": "debian-bullseye-11.0-{{ 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/debian_buster.json b/proxmox/templates/debian_buster.json index a9caaf0..f3f918f 100644 --- a/proxmox/templates/debian_buster.json +++ b/proxmox/templates/debian_buster.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": 10004, "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/cdimage/archive/10.10.0/amd64/iso-cd/debian-10.10.0-amd64-netinst.iso", "iso_checksum": "c433254a7c5b5b9e6a05f9e1379a0bd6ab3323f89b56537b684b6d1bd1f8b6ad", "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` }}/buster-preseed.cfg ", + "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-buster-10.10-{{ user `template-suffix` }}", "template_description": "debian buster, 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 f78c887..f9d7dce 100644 --- a/proxmox/templates/scripts/post-install.sh +++ b/proxmox/templates/scripts/post-install.sh @@ -1,26 +1,25 @@ #!/bin/bash -eu #### # apt configuration #### -cat </etc/apt/sources.list.d/debian.list -deb http://deb.debian.org/debian buster main -deb-src http://deb.debian.org/debian buster main +source /etc/os-release -deb http://deb.debian.org/debian-security/ buster/updates main -deb-src http://deb.debian.org/debian-security/ buster/updates main +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 buster-updates main -deb-src http://deb.debian.org/debian buster-updates 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 aptitude -y install "?priority(standard)!~i?archive(stable)" #### # Puppet #### apt-get install -y puppet gnupg