diff --git a/Vagrantfile b/Vagrantfile --- a/Vagrantfile +++ b/Vagrantfile @@ -18,6 +18,9 @@ $global_debian10_box = "debian10-20210820-1622" $global_debian10_box_url = "https://annex.softwareheritage.org/public/isos/libvirt/debian/swh-debian-10.10-amd64-20210820-1622.qcow2" +$global_debian11_box = "debian11-20210909-0725" +$global_debian11_box_url = "https://annex.softwareheritage.org/public/isos/libvirt/debian/swh-debian-11.0-amd64-20210909-0725.qcow2" + unless Vagrant.has_plugin?("libvirt") $stderr.puts <<-MSG vagrant-libvirt plugin is required for this. @@ -374,6 +377,16 @@ :cpus => 2, :environment => ENV_STAGING, }, + "test-bullseye" => { + :hostname => "test_bullseye.softwareheritage.org", + :ip => "10.168.100.131", + :type => TYPE_AGENT, + :memory => 512, + :cpus => 2, + :environment => ENV_STAGING, + :box => $global_debian11_box, + :box_url => $global_debian11_box_url, + }, } vms.each { | vm_name, vm_props | @@ -384,16 +397,21 @@ _mount_point_puppet = vm_props[:type] == TYPE_MASTER ? "/etc/puppet/code" : "/tmp/puppet" # config.ssh.insert_key = false - config.vm.box = $global_debian10_box - config.vm.box_url = $global_debian10_box_url + config.vm.box = vm_props[:box] ? vm_props[:box] : $global_debian10_box + config.vm.box_url = vm_props[:box_url] ? vm_props[:box_url] : $global_debian10_box_url config.vm.box_check_update = false config.vm.hostname = vm_props[:hostname] config.vm.network :private_network, ip: vm_props[:ip], netmask: "255.255.0.0" - config.vm.synced_folder "/tmp/puppet/", _mount_point_puppet, type: 'nfs' + # Using nfs v4 to avoid using the default nfs v3 on udp not supported by the debian 11 kernel + config.vm.synced_folder "/tmp/puppet/", _mount_point_puppet, type: 'nfs', nfs_version:4 + # Hack to speed up the puppet provisioner rsync + # It will synchronize between the same source and destination + config.vm.synced_folder "/tmp/puppet/", '/vagrant', type: 'nfs', nfs_version:4 + config.vm.synced_folder "/tmp/puppet/", '/vagrant-puppet', type: 'nfs', nfs_version:4 # ssl certificates share - config.vm.synced_folder "vagrant/le_certs", "/var/lib/puppet/letsencrypt_exports", type: 'nfs' + config.vm.synced_folder "vagrant/le_certs", "/var/lib/puppet/letsencrypt_exports", type: 'nfs', nfs_version:4 config.vm.provider :libvirt do |provider| provider.memory = vm_props[:memory] @@ -425,7 +443,9 @@ puppet.manifests_path = "#{manifests_path}" puppet.options = "#{puppet_options}" puppet.facter = _facts - puppet.synced_folder_type = 'nfs' + # Dont use nfs mount as the nfs_version can't be + # specified. The default is nfsv3 and udp which is not + # supported by the debian 11 kernel end end end diff --git a/packer/debian_buster.qemu.json b/packer/debian_bullseye.qemu.json copy from packer/debian_buster.qemu.json copy to packer/debian_bullseye.qemu.json --- a/packer/debian_buster.qemu.json +++ b/packer/debian_bullseye.qemu.json @@ -2,7 +2,7 @@ "variables": { "DISK_SIZE": "20480", "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", - "PACKER_BOX_NAME": "swh-debian-10.10-amd64-{{ user `IMAGE_TIMESTAMP` }}" + "PACKER_BOX_NAME": "swh-debian-11.0-amd64-{{ user `IMAGE_TIMESTAMP` }}" }, "builders": [ { @@ -18,7 +18,7 @@ "boot_command": [ "", "install ", - "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buster-preseed.cfg ", + "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US.UTF-8 ", "auto ", "locale=en_US.UTF-8 ", @@ -43,9 +43,9 @@ "output_directory": "output", "http_directory": "http", "iso_urls": [ - "https://cdimage.debian.org/cdimage/archive/10.10.0/amd64/iso-cd/debian-10.10.0-amd64-netinst.iso" + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.0.0-amd64-netinst.iso" ], - "iso_checksum": "c433254a7c5b5b9e6a05f9e1379a0bd6ab3323f89b56537b684b6d1bd1f8b6ad", + "iso_checksum": "ae6d563d2444665316901fe7091059ac34b8f67ba30f9159f7cef7d2fdc5bf8a", "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "vm_name": "{{ user `PACKER_BOX_NAME` }}" }], diff --git a/packer/debian_buster.qemu.json b/packer/debian_buster.qemu.json --- a/packer/debian_buster.qemu.json +++ b/packer/debian_buster.qemu.json @@ -18,7 +18,7 @@ "boot_command": [ "", "install ", - "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buster-preseed.cfg ", + "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US.UTF-8 ", "auto ", "locale=en_US.UTF-8 ", diff --git a/packer/http/buster-preseed.cfg b/packer/http/preseed.cfg rename from packer/http/buster-preseed.cfg rename to packer/http/preseed.cfg diff --git a/packer/scripts/post-install.sh b/packer/scripts/post-install.sh --- a/packer/scripts/post-install.sh +++ b/packer/scripts/post-install.sh @@ -3,15 +3,13 @@ #### # apt configuration #### +source /etc/os-release 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 ${VERSION_CODENAME} main +deb-src http://deb.debian.org/debian ${VERSION_CODENAME} 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 +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