diff --git a/Vagrantfile b/Vagrantfile index aec1eae..c472f0b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,694 +1,694 @@ Vagrant.require_version ">= 2.2.0" ENV["LC_ALL"] = "en_US.UTF-8" tmpdir = "/var/tmp/puppet" # Default configuration for all defines node below environment_path = "#{tmpdir}/environments" manifest_file = "site.pp" manifests_path = "swh-site/manifests" puppet_options = "--fileserverconfig=/etc/puppet/fileserver.conf --verbose" # --debug --trace" # used to define the local vm template path puppet_env_path = ENV["SWH_PUPPET_ENVIRONMENT_HOME"] install_facts_script_path = "vagrant/puppet_agent/install_facts.sh" # Images/local configuration (libvirt) $local_debian10_box = "debian10-20210820-1622" $local_debian10_box_url = "file://#{puppet_env_path}/packer/builds/swh-debian-10.10-amd64-20210820-1622.qcow2" # Images/remote configuration $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" +$global_debian11_box = "debian11-20220422-1345" +$global_debian11_box_url = "https://annex.softwareheritage.org/public/isos/libvirt/debian/swh-debian-11.3-amd64-20220422-1345.qcow2" unless Vagrant.has_plugin?("libvirt") $stderr.puts <<-MSG vagrant-libvirt plugin is required for this. To install: `$ sudo apt install vagrant-libvirt MSG exit 1 end TYPE_AGENT = "agent" TYPE_MASTER = "master" ENV_ADMIN = "admin" ENV_PRODUCTION = "production" ENV_STAGING = "staging" ENVIRONMENT_FACTS = { ENV_ADMIN => { "vagrant_testing" => "1", "testing" => "vagrant", "deployment" => ENV_ADMIN, "subnet" => "vagrant", "environment" => ENV_PRODUCTION, }, ENV_PRODUCTION => { "vagrant_testing" => "1", "testing" => "vagrant", "deployment" => ENV_PRODUCTION, "subnet" => "vagrant", "puppet_vardir" => "/var/lib/puppet", "environment" => ENV_PRODUCTION, }, ENV_STAGING => { "vagrant_testing" => "1", "testing" => "vagrant", "deployment" => ENV_STAGING, "subnet" => "vagrant", "environment" => ENV_STAGING, }, } vms = { ################ # STAGING ################ "staging-webapp" => { :hostname => "webapp.internal.staging.swh.network", :ip => "10.168.130.30", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, }, "staging-maven-exporter0" => { :hostname => "maven-exporter0.internal.staging.swh.network", :ip => "10.168.130.70", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, :extra_disk => 'vdb', :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "staging-rp0" => { :hostname => "rp0.internal.staging.swh.network", :ip => "10.168.130.20", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "staging-db1" => { :hostname => "db1.internal.staging.swh.network", :ip => "10.168.130.11", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "staging-storage1" => { :hostname => "storage1.internal.staging.swh.network", :ip => "10.168.130.41", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, }, "staging-objstorage0" => { :hostname => "objstorage0.internal.staging.swh.network", :ip => "10.168.130.110", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, }, "staging-deposit" => { :hostname => "deposit.internal.staging.swh.network", :ip => "10.168.130.31", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, }, "staging-worker0" => { :hostname => "worker0.internal.staging.swh.network", :ip => "10.168.130.100", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_STAGING, }, "staging-worker3" => { :hostname => "worker0.internal.staging.swh.network", :ip => "10.168.130.103", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_STAGING, }, "staging-elastic-worker0" => { :hostname => "elastic-worker0.internal.staging.swh.network", :ip => "10.168.130.130", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_STAGING, :box => $global_debian11_box, :box_url => $global_debian11_box_url, :extra_disk => 'vdb', }, "staging-scrubber0" => { :hostname => "scrubber0.internal.staging.swh.network", :ip => "10.168.130.120", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_STAGING, }, "staging-scheduler0" => { :hostname => "scheduler0.internal.staging.swh.network", :ip => "10.168.130.50", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, }, "staging-esnode0" => { :hostname => "search-esnode0.internal.staging.swh.network", :ip => "10.168.130.80", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "staging-search0" => { :hostname => "search-search0.internal.staging.swh.network", :ip => "10.168.130.90", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, }, "staging-counters0" => { :hostname => "counters0.internal.staging.swh.network", :ip => "10.168.130.95", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, }, "staging-mirror-test" => { :hostname => "mirror-test.internal.staging.swh.network", :ip => "10.168.130.160", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_STAGING, }, ################ # ADMIN ################ "bojimans" => { :hostname => "bojimans.internal.admin.swh.network", :ip => "10.168.50.60", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "dali" => { :hostname => "dali.internal.admin.swh.network", :ip => "10.168.50.50", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "admin-bardo" => { :hostname => "bardo.internal.admin.swh.network", :ip => "10.168.50.10", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "admin-rp1" => { :hostname => "rp1.internal.admin.swh.network", :ip => "10.168.50.20", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "admin-grafana0" => { :hostname => "grafana0.internal.admin.swh.network", :ip => "10.168.50.30", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "admin-backup01" => { :hostname => "backup01.euwest.azure.internal.softwareheritage.org", :ip => "10.168.200.50", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "admin-money" => { :hostname => "money.internal.admin.swh.network", :ip => "10.168.200.65", :type => TYPE_AGENT, :memory => 512, :cpus => 1, :environment => ENV_ADMIN, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, ################ # PUPPET MASTER ################ "pergamon" => { :hostname => "pergamon.softwareheritage.org", :ip => "10.168.100.29", :type => TYPE_MASTER, :memory => 3192, :cpus => 2, :environment => ENV_PRODUCTION, }, ################ # PRODUCTION ################ "prod-ns0" => { :hostname => "ns0.euwest.azure.internal.softwareheritage.org", :ip => "10.168.200.22", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "saam" => { :hostname => "saam.internal.softwareheritage.org", :ip => "10.168.100.109", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, }, "saatchi" => { :hostname => "saatchi.internal.softwareheritage.org", :ip => "10.168.100.104", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, }, "riverside" => { :hostname => "riverside.internal.admin.swh.network", :ip => "10.168.50.70", :type => TYPE_AGENT, :memory => 4096, :cpus => 4, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "kelvingrove" => { :hostname => "kelvingrove.internal.softwareheritage.org", :ip => "10.168.100.106", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "getty" => { :hostname => "getty.internal.softwareheritage.org", :type => TYPE_AGENT, :ip => "10.168.100.102", :memory => 512, :cpus => 2, :environment => ENV_PRODUCTION, }, "giverny" => { :hostname => "giverny.softwareheritage.org", :type => TYPE_AGENT, :ip => "10.168.101.118", :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-worker01" => { :hostname => "worker01.softwareheritage.org", :ip => "10.168.100.21", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-worker17" => { :hostname => "worker17.softwareheritage.org", :ip => "10.168.100.43", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, }, "esnode1" => { :hostname => "esnode1.internal.softwareheritage.org", :ip => "10.168.100.61", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "esnode2" => { :hostname => "esnode2.internal.softwareheritage.org", :ip => "10.168.100.62", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "esnode3" => { :hostname => "esnode3.internal.softwareheritage.org", :ip => "10.168.100.63", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-kibana0" => { :hostname => "kibana0.internal.softwareheritage.org", :ip => "10.168.100.50", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "logstash" => { :hostname => "logstash0.internal.softwareheritage.org", :ip => "10.168.100.19", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-webapp1" => { :hostname => "webapp1.internal.softwareheritage.org", :ip => "10.168.100.71", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-met" => { :hostname => "met.internal.softwareheritage.org", :ip => "10.168.100.110", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-moma" => { :hostname => "moma.softwareheritage.org", :ip => "10.168.100.31", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-search1" => { :hostname => "search1.internal.softwareheritage.org", :ip => "10.168.100.85", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-search-esnode4" => { :hostname => "search-esnode4.internal.softwareheritage.org", :ip => "10.168.100.86", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-search-esnode5" => { :hostname => "search-esnode5.internal.softwareheritage.org", :ip => "10.168.100.87", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-search-esnode6" => { :hostname => "search-esnode6.internal.softwareheritage.org", :ip => "10.168.100.88", :type => TYPE_AGENT, :memory => 4096, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-counters1" => { :hostname => "counters1.internal.softwareheritage.org", :ip => "10.168.100.95", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, }, "prod-kafka1" => { :hostname => "kafka1.internal.softwareheritage.org", :ip => "10.168.100.201", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-kafka2" => { :hostname => "kafka2.internal.softwareheritage.org", :ip => "10.168.100.202", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-kafka3" => { :hostname => "kafka3.internal.softwareheritage.org", :ip => "10.168.100.203", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "prod-kafka4" => { :hostname => "kafka4.internal.softwareheritage.org", :ip => "10.168.100.204", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "uffizi" => { :hostname => "uffizi.internal.softwareheritage.org", :ip => "10.168.100.101", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "branly" => { :hostname => "branly.internal.softwareheritage.org", :ip => "10.168.100.108", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "belvedere" => { :hostname => "belvedere.internal.softwareheritage.org", :ip => "10.168.100.210", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "somerset" => { :hostname => "somerset.internal.softwareheritage.org", :ip => "10.168.100.103", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "jenkins-debian1" => { :hostname => "jenkins-debian1.internal.softwareheritage.org", :ip => "10.168.100.150", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "thyssen" => { :hostname => "thyssen.internal.softwareheritage.org", :ip => "10.168.100.105", :type => TYPE_AGENT, :memory => 2048, :cpus => 2, :environment => ENV_PRODUCTION, :box => $global_debian11_box, :box_url => $global_debian11_box_url, }, "tate" => { :hostname => "tate.softwareheritage.org", :ip => "10.168.100.30", :type => TYPE_AGENT, :memory => 1024, :cpus => 2, :environment => ENV_PRODUCTION, }, ################ ## MISC ################ "test" => { :hostname => "test.softwareheritage.org", :ip => "10.168.100.130", :type => TYPE_AGENT, :memory => 512, :cpus => 2, :environment => ENV_STAGING, }, "test-bullseye" => { :hostname => "testbullseye.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, }, } Vagrant.configure("2") do |global_config| vms.each do | vm_name, vm_props | global_config.vm.define vm_name do |config| _environment_name = vm_props[:environment] _vm_facts = ENVIRONMENT_FACTS[_environment_name] _mount_point_puppet = vm_props[:type] == TYPE_MASTER ? "/etc/puppet/code" : "/tmp/puppet" # config.ssh.insert_key = false config.vm.guest = :debian 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" # Using nfs v4 to avoid using the default nfs v3 on udp not supported by the debian 11 kernel config.vm.synced_folder tmpdir, _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 tmpdir, '/vagrant', type: 'nfs', nfs_version:4 config.vm.synced_folder tmpdir, '/vagrant-puppet', type: 'nfs', nfs_version:4 # ssl certificates share 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] provider.cpus = vm_props[:cpus] # local test run: https://github.com/vagrant-libvirt/vagrant-libvirt/issues/45 provider.driver = 'kvm' if vm_props.has_key?(:extra_disk) # https://github.com/vagrant-libvirt/vagrant-libvirt#additional-disks provider.storage :file, :size => '20G', :device => vm_props[:extra_disk], :type => 'raw' end end # installs fact for `puppet agent --test` cli to work within the vm config.vm.provision :shell do |s| s.path = install_facts_script_path s.args = [ _vm_facts["deployment"], _vm_facts["subnet"] ] end if vm_props[:type] == TYPE_MASTER config.vm.provision "file", source: "vagrant/puppet_master/", destination: "/tmp/" config.vm.provision :shell, :path => "vagrant/puppet_master/prepare_puppet_master.sh" end config.vm.provision "puppet" do |puppet| puppet.environment = _vm_facts["environment"] if vm_props[:type] == TYPE_AGENT puppet.environment_path = "#{environment_path}" puppet.hiera_config_path = "#{puppet.environment_path}/#{puppet.environment}/hiera.yaml" end puppet.manifest_file = "#{manifest_file}" puppet.manifests_path = "#{manifests_path}" puppet.options = "#{puppet_options}" puppet.facter = _vm_facts # 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 puppet.synced_folder_type = 'rsync' end end end end diff --git a/packer/README.md b/packer/README.md index d0faced..7a3c424 100644 --- a/packer/README.md +++ b/packer/README.md @@ -1,156 +1,156 @@ Packer usage ============ packer [1] is used to generate the qemu/libvirt [2] images used to locally simulate the different servers and to test the puppet configuration and the service deployments. Setup ----- Packer and libvirt tools are needed to create the base image. For the packer package, [hashicorp debian repository must be installed](https://learn.hashicorp.com/tutorials/packer/getting-started-install) On debian(10) : ``` apt install packer ``` Generate a new image -------------------- ### Configuration description For the debian suite (buster, bullseye) image, these files are used: -* `debian_{suite}.qemu.json`: the configuration entrypoint describing the tasks packer - will execute to generate the image -* `http/{suite}-preseed.cfg`: The debian preseed file used by debian to manage the - installation. Debian loads it through an http server started by packer during the +* `debian_{distribution}.qemu.json`: the configuration entrypoint describing the tasks + packer will execute to generate the image +* `http/{distribution}-preseed.cfg`: The debian preseed file used by debian to manage + the installation. Debian loads it through an http server started by packer during the build. * `scripts/post-install.sh`: Poast installation steps script so vms are ready for the puppet configuration step (install puppet, manage vagrant's user key, ...) ### Build the image To build an image, use this command in the current directory: ``` packer build ``` For example, to build or rebuild the debian buster image: ``` -packer build debian_{suite}.qemu.json +packer build debian_{distribution}.qemu.json ``` :WARNING: virtualbox/qemu opens vm's console during the build. Don't interact with it to avoid interference with the packer execution. This command executes this process: * Create a new VM and boot it with the iso image defines in the ``iso_image`` parameter. * Simulate keyboard interactions to enter the ``boot_command`` which basically tells - debian to start the installation based on the ``{suite}_preseed.cfg`` file + debian to start the installation based on the ``{distribution}_preseed.cfg`` file * Call one or several provisioners after the installation to fine tune the installation. For our needs, only the ``scripts/post-install.sh`` script is executed. * package the image into a format usable by libvirt and place it in the ``builds`` directory. ### Publish the image The image must be published on the public annex site[3] to be usable. The images are published in the ``/isos/libvirt/debian``[4] directory. The ``git-annex`` usage is documented on the intranet [5]. Once the new image is published, the ``Vagrantfile`` [4] file can be updated to declare it (``$global_debian10_box`` and ``$global_debian10_box_url`` properties[6]). [1]: https://www.packer.io [2]: https://github.com/vagrant-libvirt/vagrant-libvirt [3]: https://annex.softwareheritage.org/public [4]: https://forge.softwareheritage.org/source/annex-public/browse/master/isos/virtualbox/debian/ [5]: https://intranet.softwareheritage.org/wiki/Git_annex [6]: https://forge.softwareheritage.org/source/puppet-environment/browse/master/Vagrantfile Annex ----- ### Generate a preseed file It can be useful to prepare the installation for a new debian version: * install the new version on a vm * execute the following commands: ``` apt update apt install curl debconf debconf-utils debconf-get-selections --installer > /tmp/preseed.cfg debconf-get-selections >>/tmp/preseed.cfg ``` The preseed file must be adapted to specify the user passwords or the partitioning apparently not included in the preseed file. For buster, the following lines were added: ``` d-i pkgsel/include string puppet openssh-server apt-transport-https # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade d-i pkgsel/upgrade select full-upgrade # Root password, either in clear text d-i passwd/root-password password rootroot d-i passwd/root-password-again password rootroot # To create a normal user account. d-i passwd/username string vagrant # Normal user's password, either in clear text d-i passwd/user-password password vagrant d-i passwd/user-password-again password vagrant d-i passwd/user-fullname string Vagrant # Create the first user with the specified UID instead of the default. d-i passwd/user-uid string 999 # The user account will be added to some standard initial groups. To # override that, use this. d-i passwd/user-default-groups string audio cdrom video sudo ### Partitioning d-i partman-auto/init_automatically_partition select biggest_free #d-i partman-auto/disk string /dev/vda d-i partman-auto/method string lvm # Keep some space on the lvm volume to play with snapshots d-i partman-auto-lvm/guided_size string 90% # If one of the disks that are going to be automatically partitioned # contains an old LVM configuration, the user will normally receive a # warning. This can be preseeded away... d-i partman-lvm/device_remove_lvm boolean true # The same applies to pre-existing software RAID array: d-i partman-md/device_remove_md boolean true # And the same goes for the confirmation to write the lvm partitions. d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto-lvm/no_boot boolean true d-i partman-auto/choose_recipe select atomic d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i apt-setup/cdrom/set-first boolean false d-i apt-setup/cdrom/set-next boolean false d-i apt-setup/cdrom/set-failed boolean false d-i mirror/country string manual d-i mirror/http/hostname string http.fr.debian.org d-i mirror/http/directory string /debian d-i mirror/http/proxy string d-i apt-setup/use_mirror boolean false popularity-contest popularity-contest/participate boolean false ``` Note: It's important that the vagrant user doesn't have the 1000/1000 UID/GID as puppet will try to create a user with that pair. diff --git a/packer/debian_bullseye.qemu.json b/packer/debian_bullseye.qemu.json index 4a14fb2..a25f1a7 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.0-amd64-{{ user `IMAGE_TIMESTAMP` }}" + "PACKER_BOX_NAME": "swh-debian-11.3-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.0.0-amd64-netinst.iso" + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso" ], - "iso_checksum": "ae6d563d2444665316901fe7091059ac34b8f67ba30f9159f7cef7d2fdc5bf8a", + "iso_checksum": "7892981e1da216e79fb3a1536ce5ebab157afdd20048fe458f2ae34fbc26c19b", "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" } ] ] }