fix(ci): align Vagrant prewarm profile

- Match the minimum CPU and memory used by Ubuntu Molecule platforms
- Restore Vagrant's normal key insertion after password authentication
- Cover the canonical prewarm configuration in the fixture
This commit is contained in:
Timothy Stewart
2026-08-01 09:17:53 -05:00
committed by Techno Tim
parent bbca35331d
commit 2babd39c89
2 changed files with 9 additions and 5 deletions
@@ -76,8 +76,7 @@ write_prewarm_vagrantfile() {
if [[ "$box" == 'generic/ubuntu2204' ]]; then if [[ "$box" == 'generic/ubuntu2204' ]]; then
printf '%s\n' \ printf '%s\n' \
' config.ssh.username = "vagrant"' \ ' config.ssh.username = "vagrant"' \
' config.ssh.password = "vagrant"' \ ' config.ssh.password = "vagrant"'
' config.ssh.insert_key = false'
fi fi
printf '%s\n' \ printf '%s\n' \
' config.vm.synced_folder ".", "/vagrant", disabled: true' \ ' config.vm.synced_folder ".", "/vagrant", disabled: true' \
@@ -85,8 +84,8 @@ write_prewarm_vagrantfile() {
' config.vm.boot_timeout = 600' \ ' config.vm.boot_timeout = 600' \
' config.vm.provider "virtualbox" do |virtualbox|' \ ' config.vm.provider "virtualbox" do |virtualbox|' \
' virtualbox.linked_clone = true' \ ' virtualbox.linked_clone = true' \
' virtualbox.memory = 512' \ ' virtualbox.memory = 1024' \
' virtualbox.cpus = 1' \ ' virtualbox.cpus = 2' \
' end' \ ' end' \
'end' 'end'
} > "$destination" } > "$destination"
@@ -47,7 +47,12 @@ third_output="$fixture/third-output"
"$script" > "$first_output" "$script" > "$first_output"
grep -Fq 'config.ssh.username = "vagrant"' "$MOCK_VAGRANTFILE_CAPTURE" grep -Fq 'config.ssh.username = "vagrant"' "$MOCK_VAGRANTFILE_CAPTURE"
grep -Fq 'config.ssh.password = "vagrant"' "$MOCK_VAGRANTFILE_CAPTURE" grep -Fq 'config.ssh.password = "vagrant"' "$MOCK_VAGRANTFILE_CAPTURE"
grep -Fq 'config.ssh.insert_key = false' "$MOCK_VAGRANTFILE_CAPTURE" if grep -Fq 'config.ssh.insert_key' "$MOCK_VAGRANTFILE_CAPTURE"; then
printf 'prewarm Vagrantfile unexpectedly overrides Vagrant SSH key insertion\n' >&2
exit 1
fi
grep -Fq 'virtualbox.memory = 1024' "$MOCK_VAGRANTFILE_CAPTURE"
grep -Fq 'virtualbox.cpus = 2' "$MOCK_VAGRANTFILE_CAPTURE"
grep -Fq 'config.vm.boot_timeout = 600' "$MOCK_VAGRANTFILE_CAPTURE" grep -Fq 'config.vm.boot_timeout = 600' "$MOCK_VAGRANTFILE_CAPTURE"
mapping_file="$mock_master_root/generic_ubuntu2204-4.3.12-amd64.uuid" mapping_file="$mock_master_root/generic_ubuntu2204-4.3.12-amd64.uuid"
test -s "$mapping_file" test -s "$mapping_file"