diff --git a/packer/debian_bullseye.qemu.json b/packer/debian_bullseye.qemu.json index a25f1a7..085a225 100644 --- a/packer/debian_bullseye.qemu.json +++ b/packer/debian_bullseye.qemu.json @@ -1,72 +1,72 @@ { "variables": { "DISK_SIZE": "20480", "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", - "PACKER_BOX_NAME": "swh-debian-11.3-amd64-{{ user `IMAGE_TIMESTAMP` }}" + "PACKER_BOX_NAME": "swh-debian-11.4-amd64-{{ user `IMAGE_TIMESTAMP` }}" }, "builders": [ { "headless": false, "type": "qemu", "format": "qcow2", "accelerator": "kvm", "net_device": "virtio-net", "disk_interface": "virtio", "memory": 2048, "cpus": 2, "boot_command": [ "", "install ", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US.UTF-8 ", "auto ", "locale=en_US.UTF-8 ", "kbd-chooser/method=us ", "keyboard-configuration/xkb-keymap=us ", "netcfg/get_hostname={{ .Name }} ", "netcfg/get_domain=vagrantup.com ", "fb=false ", "debconf/frontend=noninteractive ", "console-setup/ask_detect=false ", "console-keymaps-at/keymap=us ", "grub-installer/bootdev=/dev/vda ", "" ], "boot_wait": "5s", "disk_size": "{{ user `DISK_SIZE` }}", "ssh_username": "vagrant", "ssh_password": "vagrant", "ssh_port": 22, "ssh_wait_timeout": "1000s", "output_directory": "output", "http_directory": "http", "iso_urls": [ - "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso" + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.4.0-amd64-netinst.iso" ], - "iso_checksum": "7892981e1da216e79fb3a1536ce5ebab157afdd20048fe458f2ae34fbc26c19b", + "iso_checksum": "d490a35d36030592839f24e468a5b818c919943967012037d6ab3d65d030ef7f", "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "vm_name": "{{ user `PACKER_BOX_NAME` }}" }], "provisioners": [ { "type": "shell", "expect_disconnect": "true", "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/post-install.sh" ] } ], "post-processors": [ [ { "type": "vagrant", "compression_level": 9, "output": "builds/{{ user `PACKER_BOX_NAME` }}.qcow2" } ] ] } diff --git a/packer/debian_bullseye_zfs.qemu.json b/packer/debian_bullseye_zfs.qemu.json index 0716a67..8424b42 100644 --- a/packer/debian_bullseye_zfs.qemu.json +++ b/packer/debian_bullseye_zfs.qemu.json @@ -1,80 +1,80 @@ { "variables": { "DISK_SIZE": "20480", "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", - "PACKER_BOX_NAME": "swh-debian-zfs-11.3-amd64-{{ user `IMAGE_TIMESTAMP` }}" + "PACKER_BOX_NAME": "swh-debian-zfs-11.4-amd64-{{ user `IMAGE_TIMESTAMP` }}" }, "builders": [ { "headless": false, "type": "qemu", "format": "qcow2", "accelerator": "kvm", "net_device": "virtio-net", "disk_interface": "virtio", "memory": 2048, "cpus": 2, "boot_command": [ "", "install ", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US.UTF-8 ", "auto ", "locale=en_US.UTF-8 ", "kbd-chooser/method=us ", "keyboard-configuration/xkb-keymap=us ", "netcfg/get_hostname={{ .Name }} ", "netcfg/get_domain=vagrantup.com ", "fb=false ", "debconf/frontend=noninteractive ", "console-setup/ask_detect=false ", "console-keymaps-at/keymap=us ", "grub-installer/bootdev=/dev/vda ", "" ], "boot_wait": "5s", "disk_size": "{{ user `DISK_SIZE` }}", "ssh_username": "vagrant", "ssh_password": "vagrant", "ssh_port": 22, "ssh_wait_timeout": "1000s", "output_directory": "output", "http_directory": "http", "iso_urls": [ - "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso" + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.4.0-amd64-netinst.iso" ], - "iso_checksum": "7892981e1da216e79fb3a1536ce5ebab157afdd20048fe458f2ae34fbc26c19b", + "iso_checksum": "d490a35d36030592839f24e468a5b818c919943967012037d6ab3d65d030ef7f", "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "vm_name": "{{ user `PACKER_BOX_NAME` }}" }], "provisioners": [ { "type": "shell", "expect_disconnect": "true", "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/post-install.sh" ] }, { "type": "shell", "expect_disconnect": "true", "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/post-install-extra.sh" ] } ], "post-processors": [ [ { "type": "vagrant", "compression_level": 9, "output": "builds/{{ user `PACKER_BOX_NAME` }}.qcow2" } ] ] } diff --git a/packer/scripts/post-install.sh b/packer/scripts/post-install.sh index 3468478..98bb89a 100644 --- a/packer/scripts/post-install.sh +++ b/packer/scripts/post-install.sh @@ -1,70 +1,72 @@ #!/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 upgrade -y + apt-get install -y man wget curl telnet net-tools dnsutils traceroute unbound gpg #### # allow vagrant user to sudo to root without password #### cat </etc/sudoers.d/vagrant vagrant ALL= NOPASSWD: ALL EOF chmod 0440 /etc/sudoers.d/vagrant #### # Configure authorized_keys to allow vagrant command line to interact with the VM #### mkdir -m 700 /home/vagrant/.ssh curl -s https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub >> /home/vagrant/.ssh/authorized_keys chmod 0600 /home/vagrant/.ssh/authorized_keys chown -R vagrant:vagrant /home/vagrant/.ssh #### # Puppet #### apt-get install -y puppet # Configure the fileserver for the "le_certs" share # In the vm, this directory is a mount of the vagrant/le_certs directory configured on the vagrantfile mkdir -p /var/lib/puppet/letsencrypt_exports cat > /etc/puppet/fileserver.conf < /etc/network/interfaces <