diff --git a/.gitignore b/.gitignore
index 175b1f75c..14efcc395 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
*.ovf
*.vmdk
*.vdi
+*.qcow2
*.log
virtualfloppy.vfd
packer_cache/
diff --git a/AMZ_README_FIRST.md b/AMZ_README_FIRST.md
index 5393c82d2..1fd70bdbf 100644
--- a/AMZ_README_FIRST.md
+++ b/AMZ_README_FIRST.md
@@ -1,12 +1,12 @@
-This is not your normal Bento box. Instead of building a system from an ISO we're building a system from an Amazon provided VirtualBox VDI file. This means the process is a bit different than usual.
+This is not your normal Bento box. Instead of building a system from an ISO we're building a system from an Amazon provided vm hdd image files. This means the process is a bit different than usual.
# Building this box
-Simply run the AMZ_build_virtualbox-ovf.sh script
+Simply run one of the amazonlinxu-2*-build.sh scripts
-This script will:
+These scripts will:
-1. Download the VirtualBox .vdi file for Amazon Linux 2 and place it in the amz_working_files directory. Amazon hosts these at . It will name it amazon.vdi instead of the version specific name that Amazon gives it on their site
-1. It will prepare this VDI file for packer and export it as a OVF file
+1. Download the vm image file for Amazon Linux 2 or 2023 and place it in the amz_working_files directory. Amazon hosts these at and .
+1. It will prepare the VDI file for packer and export it as a OVF file
1. It will run the packer build
-1. Lastly it will clean up the leftover files in the working directory
+1. Lastly it will clean up the leftover files in the working directory on successful completion
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a6abc2b66..13dcfefa0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,9 +52,21 @@ Markdown table generated at
- Look into making all build uefi default builds
- Create CD pipeline to upload vagrant boxes after PR is merged
- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches
-- Added ability to configure bento upload of private or public boxes in builds.yml, defaults to private
-## [unreleased] (2024-02-16)
+## [unreleased] (2024-03-20)
+
+## [v4.0.2] (2024-03-20)
+
+- Update upload message to show architecture
+- Fix open-vm-tools install for vmware builds
+- Fix amazonlinux 2 build script
+- Added amazonlinux 2023 build scripts
+- Allow failed tests to continue and report at the end each test that failed
+- Added amazonlinux aarch64 packer templates
+- removed unneeded config from amazon user-data script for seed.iso
+- Added additional qemu variables for various qemu source properties
+- Added virtualbox-ovf vbox_source_path and vbox_checksum variables
+- Added recursive flag to rhel cleanup scripts for persistent network files
## [v4.0.1] (2024-02-16)
@@ -108,6 +120,7 @@ Markdown table generated at
- Updated Bento to continue builds even if one fails and report all failures at the end and exit with exit code 1
- Added qemu clone of libvirt box when metadata file is created for uploading to vagrant qemu provider
- Made build shell scripts customizable through packer variable
+- Added ability to configure bento upload of private or public boxes in builds.yml, defaults to private
## [v3.1.1] (2023-07-07)
diff --git a/README.md b/README.md
index 5a9038a61..5b074914c 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Bento is a project that encapsulates [Packer](https://www.packer.io/) templates
***NOTE:**
-- Vagrant 2.4.0+ is required for new cpu archetecture support
+- Vagrant 2.4.0+ is required for new cpu architecture support
- Virutalbox 6.x requires disabling nat config that allows vbox 7.x guests to connect to the host. To use comment out lines #161 and #162 in bento/packer_templates/pkr-variables.pkr.hcl or add variable `vboxmanage = []` to os_pkrvars files.
- When running packer build command the output directory is relative to the working directory the command is currently running in. Suggest running packer build commands from bento root directory for build working files to be placed in bento/builds/(build_name) directory by default. If the output_directory variable isn't overwritten a directory called builds/(build_name) will be created in the current working directory that you are running the command from
@@ -24,6 +24,14 @@ Vagrant.configure("2") do |config|
end
```
+### Installing Bento
+
+1. install ruby environment
+1. clone repo
+1. cd /bento
+1. gem build bento.gemspec
+1. gem install bento-*.gem
+
### Building Boxes
#### Requirements
diff --git a/AMZ_build_virtualbox-ovf.sh b/amazonlinux-2-x86_64-virtualbox-build.sh
similarity index 74%
rename from AMZ_build_virtualbox-ovf.sh
rename to amazonlinux-2-x86_64-virtualbox-build.sh
index d935dc3c9..8902e9dae 100755
--- a/AMZ_build_virtualbox-ovf.sh
+++ b/amazonlinux-2-x86_64-virtualbox-build.sh
@@ -12,10 +12,10 @@ IMG="$(wget -q https://cdn.amazonlinux.com/os-images/latest/virtualbox/ -O - | g
# Download vbox vdi
echo "Downloading Vbox VDI $IMG"
-wget -q -O "$AMZDIR"/amazon.vdi -c https://cdn.amazonlinux.com/os-images/latest/virtualbox/"$IMG"
+wget -q -O "$AMZDIR"/amazon2_x86_64.vdi -c https://cdn.amazonlinux.com/os-images/latest/virtualbox/"$IMG"
-if [ ! -f "$AMZDIR"/amazon.vdi ]; then
- echo There must be a file named amazon.vdi in "$AMZDIR"!
+if [ ! -f "$AMZDIR"/amazon2_x86_64.vdi ]; then
+ echo There must be a file named amazon2_x86_64.vdi in "$AMZDIR"!
echo You can download the vdi file at https://cdn.amazonlinux.com/os-images/latest/virtualbox/
exit 1
fi
@@ -36,8 +36,8 @@ echo "Creating the VM"
# from https://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html
VBoxManage createvm --name $VM --ostype "RedHat_64" --register
VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
-VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$AMZDIR"/amazon.vdi
-VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 1 --type dvddrive --medium "$AMZDIR"/seed.iso
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$AMZDIR"/amazon2_x86_64.vdi
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium "$AMZDIR"/seed.iso
VBoxManage modifyvm $VM --memory 2048
VBoxManage modifyvm $VM --cpus 2
VBoxManage modifyvm $VM --audio-driver none
@@ -48,18 +48,18 @@ echo Sleeping for 120 seconds to let the system boot and cloud-init to run
VBoxManage startvm $VM --type headless
sleep 120
VBoxManage controlvm $VM poweroff --type headless
-VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 1 --type dvddrive --medium none
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium none
sleep 5
echo Exporting the VM to an OVF file
-vboxmanage export $VM -o "$AMZDIR"/amazon2.ovf
+vboxmanage export $VM -o "$AMZDIR"/amazon2_x86_64.ovf
sleep 5
echo Deleting the VM
vboxmanage unregistervm $VM --delete
echo starting packer build of amazonlinux
-if packer build -timestamp-ui -only=virtualbox-ovf.amazonlinux -var-file="$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl "$AMZDIR"/../../packer_templates; then
+if packer build -timestamp-ui -var "vbox_source_path=$AMZDIR/amazon2_x86_64.ovf" -var "vbox_checksum=null" -var-file="$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl "$AMZDIR"/../../packer_templates; then
echo "Cleaning up files"
rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso
else
diff --git a/amazonlinux-2023-aarch64-virtualbox-build.sh b/amazonlinux-2023-aarch64-virtualbox-build.sh
new file mode 100755
index 000000000..5d0ec7ae8
--- /dev/null
+++ b/amazonlinux-2023-aarch64-virtualbox-build.sh
@@ -0,0 +1,75 @@
+#!/usr/bin/env bash
+
+# Getting script directory location
+SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}")
+cd "$SCRIPT_RELATIVE_DIR" || exit
+
+# set tmp dir for files
+AMZDIR="$(pwd)/packer_templates/amz_working_files"
+
+echo "Cleaning up old files"
+rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.vdi
+
+# Get virtualbox vdi file name with latest version number
+IMG="$(wget -q https://cdn.amazonlinux.com/al2023/os-images/latest/kvm-arm64/ -O - | grep ".qcow2" | cut -d "\"" -f 2)"
+
+echo "Downloading $IMG"
+wget -q -O "$AMZDIR"/amazon2023_arm64.qcow2 -c https://cdn.amazonlinux.com/al2023/os-images/latest/kvm-arm64/"$IMG"
+
+echo "Convert qcow2 to vdi"
+qemu-img convert -f qcow2 "$AMZDIR"/amazon2023_arm64.qcow2 -O vdi "$AMZDIR"/amazon2023_arm64.vdi
+
+if [ ! -f "$AMZDIR"/amazon2023_arm64.vdi ]; then
+ echo There must be a file named amazon2023_arm64.vdi in "$AMZDIR"!
+ echo You can download the files at https://cdn.amazonlinux.com/al2023/os-images/latest/
+ exit 1
+fi
+
+echo "Creating ISO"
+hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso
+
+VM="AmazonLinuxBento"
+echo Powering off and deleting any existing VMs named $VM
+VBoxManage controlvm $VM poweroff --type headless 2> /dev/null
+VBoxManage unregistervm $VM --delete 2> /dev/null
+sleep 5
+
+echo "Creating the VM"
+# from https://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html
+VBoxManage createvm --name $VM --ostype "Fedora_64" --register
+VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$AMZDIR"/amazon2023_arm64.vdi
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium "$AMZDIR"/seed.iso
+VBoxManage modifyvm $VM --chipset ich9
+VBoxManage modifyvm $VM --firmware efi
+VBoxManage modifyvm $VM --memory 2048
+VBoxManage modifyvm $VM --cpus 2
+VBoxManage modifyvm $VM --nat-localhostreachable1 on
+VBoxManage modifyvm $VM --vram 33
+VBoxManage modifyvm $VM --graphicscontroller vmsvga
+VBoxManage modifyvm $VM --vrde off
+VBoxManage modifyvm $VM --audio-driver none
+VBoxManage modifyvm $VM --ioapic on
+sleep 5
+
+echo "Sleeping for 120 seconds to let the system boot and cloud-init to run"
+VBoxManage startvm $VM --type headless
+sleep 120
+VBoxManage controlvm $VM poweroff --type headless
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium none
+sleep 5
+
+echo "Exporting the VM to an OVF file"
+vboxmanage export $VM -o "$AMZDIR"/amazon2023_arm64.ovf
+sleep 5
+
+echo "Deleting the VM"
+vboxmanage unregistervm $VM --delete
+
+echo "starting packer build of amazonlinux"
+if packer build -timestamp-ui -var "vbox_source_path=$AMZDIR/amazon2023_arm64.ovf" -var "vbox_checksum=null" -var-file="$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl "$AMZDIR"/../../packer_templates; then
+ echo "Cleaning up files"
+ rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso "$AMZDIR"/*.vdi "$AMZDIR"/*.qcow2
+else
+ exit 1
+fi
diff --git a/amazonlinux-2023-x86_64-virtualbox-build.sh b/amazonlinux-2023-x86_64-virtualbox-build.sh
new file mode 100755
index 000000000..f58fb84b6
--- /dev/null
+++ b/amazonlinux-2023-x86_64-virtualbox-build.sh
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+
+# Getting script directory location
+SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}")
+cd "$SCRIPT_RELATIVE_DIR" || exit
+
+# set tmp dir for files
+AMZDIR="$(pwd)/packer_templates/amz_working_files"
+
+echo "Cleaning up old files"
+rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.vdi
+
+# Get virtualbox vdi file name with latest version number
+IMG="$(wget -q https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/ -O - | grep ".qcow2" | cut -d "\"" -f 2)"
+
+echo "Downloading $IMG"
+wget -q -O "$AMZDIR"/amazon2023_x86_64.qcow2 -c https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/"$IMG"
+
+echo "Convert qcow2 to vdi"
+qemu-img convert -f qcow2 "$AMZDIR"/amazon2023_x86_64.qcow2 -O vdi "$AMZDIR"/amazon2023_x86_64.vdi
+
+if [ ! -f "$AMZDIR"/amazon2023_x86_64.vdi ]; then
+ echo There must be a file named amazon2023_x86_64.vdi in "$AMZDIR"!
+ echo You can download the files at https://cdn.amazonlinux.com/al2023/os-images/latest/
+ exit 1
+fi
+
+echo "Creating ISO"
+hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso
+
+VM="AmazonLinuxBento"
+echo Powering off and deleting any existing VMs named $VM
+VBoxManage controlvm $VM poweroff --type headless 2> /dev/null
+VBoxManage unregistervm $VM --delete 2> /dev/null
+sleep 5
+
+echo "Creating the VM"
+# from https://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html
+VBoxManage createvm --name $VM --ostype "Fedora_64" --register
+VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$AMZDIR"/amazon2023_x86_64.vdi
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium "$AMZDIR"/seed.iso
+VBoxManage modifyvm $VM --memory 2048
+VBoxManage modifyvm $VM --cpus 2
+VBoxManage modifyvm $VM --nat-localhostreachable1 on
+VBoxManage modifyvm $VM --vram 10
+VBoxManage modifyvm $VM --graphicscontroller vmsvga
+VBoxManage modifyvm $VM --vrde off
+VBoxManage modifyvm $VM --audio-driver none
+VBoxManage modifyvm $VM --ioapic on
+sleep 5
+
+echo "Sleeping for 120 seconds to let the system boot and cloud-init to run"
+VBoxManage startvm $VM --type headless
+sleep 120
+VBoxManage controlvm $VM poweroff --type headless
+VBoxManage storageattach $VM --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium none
+sleep 5
+
+echo "Exporting the VM to an OVF file"
+vboxmanage export $VM -o "$AMZDIR"/amazon2023_x86_64.ovf
+sleep 5
+
+echo "Deleting the VM"
+vboxmanage unregistervm $VM --delete
+
+echo "starting packer build of amazonlinux"
+if packer build -timestamp-ui -var "vbox_source_path=$AMZDIR/amazon2023_x86_64.ovf" -var "vbox_checksum=null" -var-file="$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl "$AMZDIR"/../../packer_templates; then
+ echo "Cleaning up files"
+ rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso "$AMZDIR"/*.vdi "$AMZDIR"/*.qcow2
+else
+ exit 1
+fi
diff --git a/builds.yml b/builds.yml
index 6f0cd3b65..6a3567516 100644
--- a/builds.yml
+++ b/builds.yml
@@ -6,6 +6,8 @@ default_architectures:
- 'amd64'
public:
+ - 'amazonlinux-2'
+ - 'amazonlinux-2023'
- 'almalinux-8'
- 'almalinux-9'
- 'amazon-2'
diff --git a/lib/bento/runner.rb b/lib/bento/runner.rb
index 9c3331622..b59554dcc 100644
--- a/lib/bento/runner.rb
+++ b/lib/bento/runner.rb
@@ -17,7 +17,7 @@ def initialize(opts)
@dry_run = opts.dry_run
@metadata_only = opts.metadata_only
@debug = opts.debug
- @only = opts.only ||= 'parallels-iso.vm,virtualbox-iso.vm,vmware-iso.vm,qemu.vm'
+ @only = opts.only ||= nil
@except = opts.except
@mirror = opts.mirror
@headed = opts.headed ||= false
@@ -87,7 +87,7 @@ def packer_build_cmd(template, _var_file)
var_files.each do |var_file|
cmd.insert(5, "-var-file=#{var_file}") if File.exist?(var_file)
end if var_files
- cmd.insert(4, "-only=#{only}")
+ cmd.insert(4, "-only=#{only}") if only
cmd.insert(4, "-except=#{except}") if except
# Build the command line in the correct order and without spaces as future input for the splat operator.
cmd.insert(4, "-var cpus=#{cpus}") if cpus
diff --git a/lib/bento/test.rb b/lib/bento/test.rb
index b4a572f56..21c2b684d 100644
--- a/lib/bento/test.rb
+++ b/lib/bento/test.rb
@@ -5,12 +5,13 @@
class TestRunner
include Common
- attr_reader :shared_folder, :boxname, :provider, :box_url, :no_shared, :provisioner
+ attr_reader :shared_folder, :boxname, :provider, :box_url, :no_shared, :provisioner, :errors
def initialize(opts)
@debug = opts.debug
@no_shared = opts.no_shared
@provisioner = opts.provisioner.nil? ? 'shell' : opts.provisioner
+ @errors = []
end
def start
@@ -23,6 +24,9 @@ def start
end
end
banner("Testing finished in #{duration(time.real)}.")
+ unless errors.empty?
+ raise("Failed Tests:\n #{errors.join("\n")}\n exited #{$CHILD_STATUS}")
+ end
end
private
@@ -45,8 +49,17 @@ def test_box(md_json)
temp_dir = "#{bento_dir}/builds/test-kitchen"
Dir.mkdir(temp_dir) unless Dir.exist?(temp_dir)
md = box_metadata(md_json)
+ arch = case md['arch']
+ when 'x86_64', 'amd64'
+ 'amd64'
+ when 'aarch64', 'arm64'
+ 'arm64'
+ else
+ raise "Unknown arch #{md_data.inspect}"
+ end
@boxname = md['name']
@providers = md['providers']
+ @arch = arch
@share_disabled = no_shared || /(bsd|opensuse)/.match(boxname) ? true : false
dir = "#{File.expand_path('../../', File.dirname(__FILE__))}/lib/bento/test_templates"
@@ -58,9 +71,14 @@ def test_box(md_json)
Dir.chdir(temp_dir)
banner("Test kitchen file located in #{temp_dir}")
- test = Mixlib::ShellOut.new('kitchen test', timeout: 900, live_stream: STDOUT)
- test.run_command
- test.error!
+ @providers.each do |k, _v|
+ test = Mixlib::ShellOut.new("kitchen test #{@boxname}-#{@arch}-#{k.tr('_', '-')}", timeout: 900, live_stream: STDOUT)
+ test.run_command
+ if test.error?
+ test.stderr
+ errors << "#{@boxname}-#{@arch}-#{k}"
+ end
+ end
Dir.chdir(bento_dir)
FileUtils.rm_rf(temp_dir)
end
diff --git a/lib/bento/test_templates/kitchen.yml.erb b/lib/bento/test_templates/kitchen.yml.erb
index f676bab8f..56836444e 100644
--- a/lib/bento/test_templates/kitchen.yml.erb
+++ b/lib/bento/test_templates/kitchen.yml.erb
@@ -4,13 +4,14 @@ provisioner:
platforms:
<% @providers.each do |k,v| -%>
-- name: <%= @boxname + '-' + k %>
+- name: <%= "#{@boxname}-#{@arch}-#{k}" %>
driver:
name: vagrant
provider: <%= k %>
vm_hostname: bento-test
box: bento-<%= @boxname %>
box_url: file://<%= Dir.pwd %>/builds/<%= v['file'] %>
+ box_arch: <%= @arch %>
synced_folders:
<% if k =~ /hyperv/ -%>
- [".", "/vagrant", "disabled: true"]
diff --git a/lib/bento/upload.rb b/lib/bento/upload.rb
index d9c5699ca..582cc9d70 100644
--- a/lib/bento/upload.rb
+++ b/lib/bento/upload.rb
@@ -45,14 +45,14 @@ def upload_box(md_file)
md_data['providers'].each_pair do |prov, prov_data|
if File.exist?(File.join('builds', prov_data['file']))
puts ''
- banner("Uploading #{builds_yml['vagrant_cloud_account']}/#{md_data['box_basename']} version:#{md_data['version']} provider:#{prov}...")
+ banner("Uploading #{builds_yml['vagrant_cloud_account']}/#{md_data['box_basename']} version:#{md_data['version']} provider:#{prov} arch:#{arch}...")
upload_cmd = "vagrant cloud publish --architecture #{arch} #{default_arch(arch)} --no-direct-upload #{builds_yml['vagrant_cloud_account']}/#{md_data['box_basename']} #{md_data['version']} #{prov} builds/#{prov_data['file']} --description '#{box_desc(md_data['box_basename'])}' --short-description '#{box_desc(md_data['box_basename'])}' --version-description '#{ver_desc(md_data)}' --force --release #{public_private_box(md_data['box_basename'])}"
shellout(upload_cmd)
slug_name = lookup_slug(md_data['name'])
if slug_name
puts ''
- banner("Uploading slug #{builds_yml['vagrant_cloud_account']}/#{slug_name} from #{md_data['box_basename']} version:#{md_data['version']} provider:#{prov}...")
+ banner("Uploading slug #{builds_yml['vagrant_cloud_account']}/#{slug_name} from #{md_data['box_basename']} version:#{md_data['version']} provider:#{prov} arch:#{arch}...")
upload_cmd = "vagrant cloud publish --architecture #{arch} --no-direct-upload #{builds_yml['vagrant_cloud_account']}/#{slug_name} #{md_data['version']} #{prov} builds/#{prov_data['file']} --description '#{slug_desc(slug_name)}' --short-description '#{slug_desc(slug_name)}' --version-description '#{ver_desc(md_data)}' --force --release #{public_private_box(md_data['box_basename'])}"
shellout(upload_cmd)
end
diff --git a/lib/bento/version.rb b/lib/bento/version.rb
index afc40757d..9cba61623 100644
--- a/lib/bento/version.rb
+++ b/lib/bento/version.rb
@@ -1,3 +1,3 @@
module Bento
- VERSION = '4.0.0'.freeze
+ VERSION = '4.0.2'.freeze
end
diff --git a/os_pkrvars/amazonlinux/amazonlinux-2-aarch64.pkrvars.hcl b/os_pkrvars/amazonlinux/amazonlinux-2-aarch64.pkrvars.hcl
new file mode 100644
index 000000000..0895fcfd9
--- /dev/null
+++ b/os_pkrvars/amazonlinux/amazonlinux-2-aarch64.pkrvars.hcl
@@ -0,0 +1,11 @@
+os_name = "amazonlinux"
+os_version = "2"
+os_arch = "aarch64"
+vbox_source_path = "https://cdn.amazonlinux.com/os-images/latest/kvm-arm64/amzn2-kvm-2.0.20240306.2-arm64.xfs.gpt.qcow2"
+vbox_checksum = "file:https://cdn.amazonlinux.com/os-images/latest/kvm-arm64/SHA256SUMS"
+parallels_guest_os_type = "fedora-core"
+vbox_guest_os_type = "Fedora_64"
+vmware_guest_os_type = "arm-fedora-64"
+sources_enabled = [
+ "source.virtualbox-ovf.vm"
+]
diff --git a/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl b/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl
index 4707acc7d..08baf9a58 100644
--- a/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl
+++ b/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl
@@ -1,21 +1,11 @@
os_name = "amazonlinux"
os_version = "2"
os_arch = "x86_64"
-vbox_guest_os_type = "RedHat_64"
+vbox_source_path = "https://cdn.amazonlinux.com/os-images/latest/virtualbox/amzn2-virtualbox-2.0.20240306.2-x86_64.xfs.gpt.vdi"
+vbox_checksum = "file:https://cdn.amazonlinux.com/os-images/latest/virtualbox/SHA256SUMS"
+parallels_guest_os_type = "centos"
+vbox_guest_os_type = "RedHat_64"
+vmware_guest_os_type = "rhel9-64"
sources_enabled = [
- "source.virtualbox-ovf.amazonlinux"
-]
-vboxmanage = [
- [
- "modifyvm",
- "{{ .Name }}",
- "--memory",
- "2048",
- "--cpus",
- "2",
- "--audio",
- "none",
- "--nat-localhostreachable1",
- "on",
- ]
+ "source.virtualbox-ovf.vm"
]
diff --git a/os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl b/os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl
new file mode 100644
index 000000000..6a72f30af
--- /dev/null
+++ b/os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl
@@ -0,0 +1,11 @@
+os_name = "amazonlinux"
+os_version = "2023"
+os_arch = "aarch64"
+vbox_source_path = "https://cdn.amazonlinux.com/al2023/os-images/2023.3.20240312.0/vmware/al2023-vmware_esx-2023.3.20240312.0-kernel-6.1-x86_64.xfs.gpt.ova"
+vbox_checksum = "file:https://cdn.amazonlinux.com/al2023/os-images/2023.3.20240312.0/vmware/SHA256SUMS"
+parallels_guest_os_type = "fedora-core"
+vbox_guest_os_type = "Fedora_64"
+vmware_guest_os_type = "arm-fedora-64"
+sources_enabled = [
+ "source.virtualbox-ovf.vm"
+]
diff --git a/os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl b/os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl
index 421326585..b059b2b4a 100644
--- a/os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl
+++ b/os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl
@@ -1,21 +1,11 @@
-os_name = "amazonlinux"
-os_version = "2023"
-os_arch = "x86_64"
-vbox_guest_os_type = "RedHat_64"
+os_name = "amazonlinux"
+os_version = "2023"
+os_arch = "x86_64"
+vbox_source_path = "https://cdn.amazonlinux.com/al2023/os-images/latest/vmware/al2023-vmware_esx-2023.3.20240312.0-kernel-6.1-x86_64.xfs.gpt.ova"
+vbox_checksum = "file:https://cdn.amazonlinux.com/al2023/os-images/latest/vmware/SHA256SUMS"
+parallels_guest_os_type = "fedora-core"
+vbox_guest_os_type = "Fedora_64"
+vmware_guest_os_type = "fedora-64"
sources_enabled = [
- "source.virtualbox-ovf.amazonlinux"
-]
-vboxmanage = [
- [
- "modifyvm",
- "{{ .Name }}",
- "--memory",
- "2048",
- "--cpus",
- "2",
- "--audio",
- "none",
- "--nat-localhostreachable1",
- "on",
- ]
+ "source.virtualbox-ovf.vm"
]
diff --git a/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl
index c9cb1a8bc..1d5b199f2 100644
--- a/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl
+++ b/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://quantum-mirror.hu/mirrors/pub/centos-altarch/
iso_checksum = "file:https://quantum-mirror.hu/mirrors/pub/centos-altarch/7.9.2009/isos/aarch64/sha256sum.txt"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg x"]
diff --git a/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl
index 20fb10372..08d946e6b 100644
--- a/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl
+++ b/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://mirrors.edge.kernel.org/centos/8-stream/isos/
iso_checksum = "file:https://mirrors.edge.kernel.org/centos/8-stream/isos/aarch64/CHECKSUM"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"]
diff --git a/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl
index 9acbd0cf6..635e561ba 100644
--- a/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl
+++ b/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://mirror.stream.centos.org/9-stream/BaseOS/aarc
iso_checksum = "file:https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/iso/CentOS-Stream-9-latest-aarch64-dvd1.iso.SHA256SUM"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-rhel9-64"
boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"]
diff --git a/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl b/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl
index 88909284d..e06e354f1 100644
--- a/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl
+++ b/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://cdimage.debian.org/cdimage/archive/latest-old
iso_checksum = "file:https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
-vmware_guest_os_type = "arm-debian-64"
+vmware_guest_os_type = "arm-debian11-64"
boot_command = ["einstall preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/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 "]
diff --git a/os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl b/os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl
index 1fcfb21ac..a1f98a930 100644
--- a/os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl
+++ b/os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://cdimage.debian.org/cdimage/release/12.5.0/arm
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.5.0/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
-vmware_guest_os_type = "arm-debian-64"
+vmware_guest_os_type = "arm-debian12-64"
boot_command = ["einstall preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/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 "]
diff --git a/os_pkrvars/freebsd/freebsd-13-aarch64.pkrvars.hcl b/os_pkrvars/freebsd/freebsd-13-aarch64.pkrvars.hcl
index b467c948e..d981c6986 100644
--- a/os_pkrvars/freebsd/freebsd-13-aarch64.pkrvars.hcl
+++ b/os_pkrvars/freebsd/freebsd-13-aarch64.pkrvars.hcl
@@ -1,9 +1,9 @@
os_name = "freebsd"
-os_version = "13.2"
+os_version = "13.3"
os_arch = "aarch64"
-iso_url = "https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-disc1.iso"
-iso_checksum = "file:https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/CHECKSUM.SHA256-FreeBSD-13.2-RELEASE-arm64-aarch64"
+iso_url = "https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.3/FreeBSD-13.3-RELEASE-arm64-aarch64-disc1.iso"
+iso_checksum = "file:https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.3/CHECKSUM.SHA256-FreeBSD-13.3-RELEASE-arm64-aarch64"
parallels_guest_os_type = "freebsd"
vbox_guest_os_type = "FreeBSD_64"
-vmware_guest_os_type = "arm-freebsd-64"
+vmware_guest_os_type = "arm-freebsd13-64"
boot_command = ["boot -s/bin/shmdmfs -s 100m md1 /tmpmdmfs -s 100m md2 /mntdhclient -p /tmp/dhclient.em0.pid -l /tmp/dhclient.lease.em0 em0fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd/installerconfig && bsdinstall script /tmp/installerconfig"]
diff --git a/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl b/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl
index 74d59042e..1b14f89e3 100644
--- a/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl
+++ b/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl
@@ -1,8 +1,8 @@
os_name = "freebsd"
-os_version = "13.2"
+os_version = "13.3"
os_arch = "x86_64"
-iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-amd64-disc1.iso"
-iso_checksum = "file:https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.2/CHECKSUM.SHA256-FreeBSD-13.2-RELEASE-amd64"
+iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.3/FreeBSD-13.3-RELEASE-amd64-disc1.iso"
+iso_checksum = "file:https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.3/CHECKSUM.SHA256-FreeBSD-13.3-RELEASE-amd64"
parallels_guest_os_type = "freebsd"
vbox_guest_os_type = "FreeBSD_64"
vmware_guest_os_type = "freebsd-64"
diff --git a/os_pkrvars/freebsd/freebsd-14-aarch64.pkrvars.hcl b/os_pkrvars/freebsd/freebsd-14-aarch64.pkrvars.hcl
index 69344d36c..f2dfcfdb6 100644
--- a/os_pkrvars/freebsd/freebsd-14-aarch64.pkrvars.hcl
+++ b/os_pkrvars/freebsd/freebsd-14-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://download.freebsd.org/releases/arm64/aarch64/I
iso_checksum = "file:https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.0/CHECKSUM.SHA256-FreeBSD-14.0-RELEASE-arm64-aarch64"
parallels_guest_os_type = "freebsd"
vbox_guest_os_type = "FreeBSD_64"
-vmware_guest_os_type = "arm-freebsd-64"
+vmware_guest_os_type = "arm-freebsd14-64"
boot_command = ["boot -s/bin/shmdmfs -s 100m md1 /tmpmdmfs -s 100m md2 /mntdhclient -p /tmp/dhclient.em0.pid -l /tmp/dhclient.lease.em0 em0fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd/installerconfig && bsdinstall script /tmp/installerconfig"]
diff --git a/os_pkrvars/opensuse/opensuse-leap-15-aarch64.pkrvars.hcl b/os_pkrvars/opensuse/opensuse-leap-15-aarch64.pkrvars.hcl
index ae1d00738..29b434d07 100644
--- a/os_pkrvars/opensuse/opensuse-leap-15-aarch64.pkrvars.hcl
+++ b/os_pkrvars/opensuse/opensuse-leap-15-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "http://provo-mirror.opensuse.org/distribution/leap/15
iso_checksum = "file:https://provo-mirror.opensuse.org/distribution/leap/15.5/iso/openSUSE-Leap-15.5-DVD-aarch64-Media.iso.sha256"
parallels_guest_os_type = "opensuse"
vbox_guest_os_type = "OpenSUSE_64"
-vmware_guest_os_type = "arm-opensuse-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e biosdevname=0 net.ifnames=0 netdevice=eth0 netsetup=dhcp lang=en_US textmode=1 modprobe.blacklist=vmwgfx autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse/autoinst-uefi.xml"]
diff --git a/os_pkrvars/oracle/oracle-7-aarch64.pkrvars.hcl b/os_pkrvars/oracle/oracle-7-aarch64.pkrvars.hcl
index ec6471c14..67873935e 100644
--- a/os_pkrvars/oracle/oracle-7-aarch64.pkrvars.hcl
+++ b/os_pkrvars/oracle/oracle-7-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL7/u9/aarch6
iso_checksum = "fd2c1b1e26858576534f6e6c4cf000a15cd81bec010dad5e827b204a14a1750e"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg x"]
diff --git a/os_pkrvars/oracle/oracle-8-aarch64.pkrvars.hcl b/os_pkrvars/oracle/oracle-8-aarch64.pkrvars.hcl
index dd1c6561d..8656e267d 100644
--- a/os_pkrvars/oracle/oracle-8-aarch64.pkrvars.hcl
+++ b/os_pkrvars/oracle/oracle-8-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL8/u9/aarch6
iso_checksum = "c732ec9bb4a85349c0f1ca82020a8514341247506d114b8b79ec32bf99d59ea0"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"]
diff --git a/os_pkrvars/oracle/oracle-9-aarch64.pkrvars.hcl b/os_pkrvars/oracle/oracle-9-aarch64.pkrvars.hcl
index f5384427d..2357d748e 100644
--- a/os_pkrvars/oracle/oracle-9-aarch64.pkrvars.hcl
+++ b/os_pkrvars/oracle/oracle-9-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL9/u3/aarch6
iso_checksum = "7cc50a48f361cb1100a28621ba455edaac3a38182f6dd3fe67588b3eeaf18dc3"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-rhel9-64"
boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"]
diff --git a/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl
index a6c26ef33..940473f9a 100644
--- a/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl
+++ b/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://www.redhat.com/en/technologies/linux-platform
iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b"
parallels_guest_os_type = "rhel"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"]
diff --git a/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl
index 0785f59d0..e5950dceb 100644
--- a/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl
+++ b/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://www.redhat.com/en/technologies/linux-platform
iso_checksum = "none"
parallels_guest_os_type = "rhel"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"]
diff --git a/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl
index 345324625..42d86f15d 100644
--- a/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl
+++ b/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://www.redhat.com/en/technologies/linux-platform
iso_checksum = "none"
parallels_guest_os_type = "rhel"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-rhel9-64"
boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"]
diff --git a/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl b/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl
index 9a542230e..8f769dde5 100644
--- a/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl
+++ b/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl
@@ -5,5 +5,5 @@ iso_url = "https://download.rockylinux.org/pub/rocky/8/isos/aarc
iso_checksum = "file:https://download.rockylinux.org/pub/rocky/8/isos/aarch64/CHECKSUM"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
-vmware_guest_os_type = "arm-centos-64"
+vmware_guest_os_type = "arm-other-64"
boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"]
diff --git a/packer_templates/amz_seed_iso/user-data b/packer_templates/amz_seed_iso/user-data
index 222eb4e59..078342858 100644
--- a/packer_templates/amz_seed_iso/user-data
+++ b/packer_templates/amz_seed_iso/user-data
@@ -1,29 +1,15 @@
#cloud-config
#vim:syntax=yaml
-user: vagrant
-password: vagrant
+users:
+ - name: vagrant
+ lock_passwd: false
+ passwd: $6$TbOu26d1hYO4EC/D$MymO7cTo/tID7tkH8TtAGyAdaK9nHwGQfDD9KwQmql3xP1BPPc67YCmoR8UO3Dw5jacOx3GvnBLqvAmHLHC4H0
+ sudo: ALL=(ALL) NOPASSWD:ALL
-# install packages for vbox guest additions to complete
-packages:
- - gcc
- - kernel-devel
- - kernel-headers
- - dkms
- - make
- - bzip2
- - perl
-
-# make sure we don't setup the network on every boot
+# Enable password authentication for SSH
write_files:
- - path: /etc/cloud/cloud.cfg.d/80_disable_network_after_firstboot.cfg
- content: |
- # Disable network configuration after first boot
- network:
- config: disabled
-
- path: /etc/cloud/cloud.cfg.d/90_enable_ssh_pwauth.cfg
content: |
runcmd:
- sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config
- - sed -i "/^HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-eth0
- - systemctl restart network sshd
+ - systemctl restart sshd
diff --git a/packer_templates/pkr-builder.pkr.hcl b/packer_templates/pkr-builder.pkr.hcl
index c72fe7c37..65fc57203 100644
--- a/packer_templates/pkr-builder.pkr.hcl
+++ b/packer_templates/pkr-builder.pkr.hcl
@@ -118,7 +118,7 @@ locals {
"${path.root}/scripts/_common/deregister_rhsm.sh",
"${path.root}/scripts/_common/minimize.sh"
] : (
- "${var.os_name}-${substr(var.os_version, 0, 1)}" == "amazonlinux-2" ||
+ "${var.os_name}-${var.os_version}" == "amazonlinux-2" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "centos-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "oracle-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "rhel-7" ? [
diff --git a/packer_templates/pkr-sources.pkr.hcl b/packer_templates/pkr-sources.pkr.hcl
index 25f92d8ee..2fe6dbb03 100644
--- a/packer_templates/pkr-sources.pkr.hcl
+++ b/packer_templates/pkr-sources.pkr.hcl
@@ -54,11 +54,6 @@ locals {
var.is_windows ? "attach" : "upload"
) : var.vbox_guest_additions_mode
- # virtualbox-ovf
- vbox_source = var.vbox_source == null ? (
- var.os_name == "amazonlinux" ? "${path.root}/amz_working_files/amazon2.ovf" : null
- ) : var.vbox_source
-
# vmware-iso
vmware_tools_upload_flavor = var.vmware_tools_upload_flavor == null ? (
var.is_windows ? "windows" : "linux"
@@ -174,11 +169,17 @@ source "parallels-iso" "vm" {
}
source "qemu" "vm" {
# QEMU specific options
- accelerator = var.qemu_accelerator
- display = var.headless ? "none" : var.qemu_display
- machine_type = local.qemu_machine_type
- qemu_binary = local.qemu_binary
- qemuargs = local.qemuargs
+ accelerator = var.qemu_accelerator
+ display = var.headless ? "none" : var.qemu_display
+ disk_image = var.qemu_disk_image
+ efi_boot = var.qemu_efi_boot
+ efi_firmware_code = var.qemu_efi_firmware_code
+ efi_firmware_vars = var.qemu_efi_firmware_vars
+ efi_drop_efivars = var.qemu_efi_drop_efivars
+ format = var.qemu_format
+ machine_type = local.qemu_machine_type
+ qemu_binary = local.qemu_binary
+ qemuargs = local.qemuargs
# Source block common options
boot_command = var.boot_command
boot_wait = var.qemu_boot_wait == null ? local.default_boot_wait : var.qemu_boot_wait
@@ -241,10 +242,11 @@ source "virtualbox-iso" "vm" {
winrm_username = var.winrm_username
vm_name = local.vm_name
}
-source "virtualbox-ovf" "amazonlinux" {
+source "virtualbox-ovf" "vm" {
# Virtualbox specific options
guest_additions_path = var.vbox_guest_additions_path
- source_path = local.vbox_source
+ source_path = var.vbox_source_path
+ checksum = var.vbox_checksum
vboxmanage = var.vboxmanage
virtualbox_version_file = var.virtualbox_version_file
# Source block common options
diff --git a/packer_templates/pkr-variables.pkr.hcl b/packer_templates/pkr-variables.pkr.hcl
index 049ca0d6d..a09aca878 100644
--- a/packer_templates/pkr-variables.pkr.hcl
+++ b/packer_templates/pkr-variables.pkr.hcl
@@ -38,7 +38,6 @@ variable "no_proxy" {
variable "sources_enabled" {
type = list(string)
default = [
- "source.hyperv-iso.vm",
"source.parallels-iso.vm",
"source.qemu.vm",
"source.virtualbox-iso.vm",
@@ -119,6 +118,36 @@ variable "qemu_display" {
type = string
default = "none"
}
+variable "qemu_disk_image" {
+ type = bool
+ default = null
+ description = "Whether iso_url is a bootable qcow2 disk image"
+}
+variable "qemu_efi_boot" {
+ type = bool
+ default = false
+ description = "Enable EFI boot"
+}
+variable "qemu_efi_firmware_code" {
+ type = string
+ default = null
+ description = "EFI firmware code path"
+}
+variable "qemu_efi_firmware_vars" {
+ type = string
+ default = null
+ description = "EFI firmware vars file path"
+}
+variable "qemu_efi_drop_efivars" {
+ type = bool
+ default = false
+ description = "Drop EFI vars"
+}
+variable "qemu_format" {
+ type = string
+ default = "qcow2"
+ description = "Disk format, takes qcow2 or raw"
+}
variable "qemu_machine_type" {
type = string
default = null
@@ -185,9 +214,15 @@ variable "virtualbox_version_file" {
}
# virtualbox-ovf
-variable "vbox_source" {
- type = string
- default = null
+variable "vbox_source_path" {
+ type = string
+ default = null
+ description = "Path to the OVA/OVF file"
+}
+variable "vbox_checksum" {
+ type = string
+ default = null
+ description = "Checksum of the OVA/OVF file"
}
# vmware-iso
@@ -220,7 +255,7 @@ variable "vmware_tools_upload_path" {
}
variable "vmware_version" {
type = number
- default = 20
+ default = 21
}
variable "vmware_vmx_data" {
type = map(string)
diff --git a/packer_templates/scripts/_common/vmware_rhel.sh b/packer_templates/scripts/_common/vmware_rhel.sh
index 835230df6..d8f8e7399 100644
--- a/packer_templates/scripts/_common/vmware_rhel.sh
+++ b/packer_templates/scripts/_common/vmware_rhel.sh
@@ -1,18 +1,20 @@
-#!/bin/sh -eux
+#!/bin/bash -eux
# set a default HOME_DIR environment variable if not set
-HOME_DIR="${HOME_DIR:-/home/vagrant}";
+HOME_DIR="${HOME_DIR:-/home/vagrant}"
case "$PACKER_BUILDER_TYPE" in
vmware-iso|vmware-vmx)
- # determine the major EL version we're runninng
- major_version="$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}')";
+ # determine the major EL version we're runninng
+ major_version="$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}')"
- # make sure we use dnf on EL 8+
- if [ "$major_version" -ge 8 ]; then
- dnf -y install open-vm-tools
- else
- yum -y install open-vm-tools
- fi
- ;;
+ # make sure we use dnf on EL 8+
+ if [ "$major_version" -ge 8 ]; then
+ dnf install -y open-vm-tools
+ else
+ yum install -y open-vm-tools
+ fi
+
+ systemctl enable vmtoolsd
+ systemctl start vmtoolsd
esac
diff --git a/packer_templates/scripts/rhel/cleanup_dnf.sh b/packer_templates/scripts/rhel/cleanup_dnf.sh
index 7f8ddd206..2018ca3c4 100644
--- a/packer_templates/scripts/rhel/cleanup_dnf.sh
+++ b/packer_templates/scripts/rhel/cleanup_dnf.sh
@@ -26,9 +26,9 @@ echo "clean all package cache information"
dnf -y clean all --enablerepo=\*
# Clean up network interface persistence
-rm -f /etc/udev/rules.d/70-persistent-net.rules;
+rm -rf /etc/udev/rules.d/70-persistent-net.rules;
mkdir -p /etc/udev/rules.d/70-persistent-net.rules;
-rm -f /lib/udev/rules.d/75-persistent-net-generator.rules;
+rm -rf /lib/udev/rules.d/75-persistent-net-generator.rules;
rm -rf /dev/.udev/;
if test -f /etc/sysconfig/network-scripts/ifcfg-*; then