diff --git a/packer/debian_buster.json b/packer/debian_buster.json deleted file mode 100644 index edf7891..0000000 --- a/packer/debian_buster.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "variables": { - "DISK_SIZE": "20480", - "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", - "PACKER_BOX_NAME": "swh-debian-10.6-amd64-{{ user `IMAGE_TIMESTAMP` }}" - }, - "builders": [ - { - "headless": false, - "type": "virtualbox-iso", - "guest_os_type": "Debian_64", - "guest_additions_mode": "upload", - "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", - "virtualbox_version_file": ".vbox_version", - "vboxmanage": [ - [ "modifyvm", "{{.Name}}", "--memory", "2048" ], - [ "modifyvm", "{{.Name}}", "--cpus", "2" ] - ], - - "boot_command": [ - "", - "install ", - "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buster-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/sda ", - "" - ], - - "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-10.6.0-amd64-netinst.iso" - ], - "iso_checksum": "2af8f43d4a7ab852151a7f630ba596572213e17d3579400b5648eba4cc974ed0", - "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": "false", - "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", - "scripts": [ - "scripts/install-vbguest.sh" - ] - } - ], - - "post-processors": [ - [ - { - "type": "vagrant", - "compression_level": 9, - "output": "builds/{{ user `PACKER_BOX_NAME` }}.box" - } - ] - ] - - } diff --git a/packer/debian_buster.qemu.json b/packer/debian_buster.qemu.json index 48e3050..878d996 100644 --- a/packer/debian_buster.qemu.json +++ b/packer/debian_buster.qemu.json @@ -1,72 +1,72 @@ { "variables": { "DISK_SIZE": "20480", "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", - "PACKER_BOX_NAME": "swh-debian-10.6-amd64-{{ user `IMAGE_TIMESTAMP` }}" + "PACKER_BOX_NAME": "swh-debian-10.9-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 }}/buster-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-10.6.0-amd64-netinst.iso" + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.9.0-amd64-netinst.iso" ], - "iso_checksum": "2af8f43d4a7ab852151a7f630ba596572213e17d3579400b5648eba4cc974ed0", + "iso_checksum": "8660593d10de0ce7577c9de4dab886ff540bc9843659c8879d8eea0ab224c109", "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/scripts/post-install.sh b/packer/scripts/post-install.sh index 96461dc..9ab20f5 100644 --- a/packer/scripts/post-install.sh +++ b/packer/scripts/post-install.sh @@ -1,71 +1,72 @@ #!/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 deb http://deb.debian.org/debian-security/ buster/updates main deb-src http://deb.debian.org/debian-security/ buster/updates main deb http://deb.debian.org/debian buster-updates main deb-src http://deb.debian.org/debian buster-updates main EOF export DEBIAN_FRONTEND=noninteractive apt-get update 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 <