From 7bbfea46d8214dc5f13ecacef923b24103613ebf Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Mon, 5 Feb 2024 17:43:51 -0600 Subject: [PATCH] vagrant cloud cpu architecture support added (#1546) * vagrant cloud cpu architecture support added --- CHANGELOG.md | 79 +++++++++-------- README.md | 22 ++--- builds.yml | 37 +------- lib/bento/buildmetadata.rb | 14 +--- lib/bento/cli.rb | 9 ++ lib/bento/runner.rb | 6 +- lib/bento/upload.rb | 29 ++++--- lib/bento/version.rb | 2 +- packer_templates/http/springdalelinux/7ks.cfg | 81 ------------------ packer_templates/http/springdalelinux/8ks.cfg | 84 ------------------- packer_templates/http/springdalelinux/9ks.cfg | 82 ------------------ packer_templates/http/ubuntu/user-data | 6 +- 12 files changed, 91 insertions(+), 360 deletions(-) delete mode 100644 packer_templates/http/springdalelinux/7ks.cfg delete mode 100644 packer_templates/http/springdalelinux/8ks.cfg delete mode 100644 packer_templates/http/springdalelinux/9ks.cfg diff --git a/CHANGELOG.md b/CHANGELOG.md index da48662fa..0b7ad41a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,41 +5,41 @@ ***Note:** Markdown table generated at -| | hyperv
x86_64 | parallels
x86_64 | parallels
aarch64 | qemu
x86_64 | qemu
aarch64 | virtualbox
x86_64 | virtualbox
aarch64 | vmware
x86_64 | vmware
aarch64 | -|:-----------------:|:---:|:---:|:--------------------:|:---:|:---:|:---:|:---:|:---:|:---:| -| almalinux-8 | | x | | x | | x | | x | | -| almalinux-9 | | x | x | | | x | | x | x | -| amazonlinux-2 | | na | na | | | | na | | na | -| amazonlinux-2023 | na | na | na | na | na | na | na | na | na | -| centos-7 | | x | | x | | x | | x | | -| centos-stream-8 | | x | | x | | x | | x | | -| centos-stream-9 | | | x | | | | | | | -| debian-11 | | x | x | | | x | | x | | -| debian-12 | | x | x | | | x | | x | x | -| fedora-38 | | x | | x | | x | | x | x | -| fedora-39 | | | | | | | | | | -| freebsd-12 | | | | | | x | | x | | -| freebsd-13 | | | | | | x | | x | | -| opensuse-leap-15 | | x | | x | | x | | x | | -| oraclelinux-7 | | x | | x | | x | | x | | -| oraclelinux-8 | | | | x | | x | | x | | -| oraclelinux-9 | | x | x | | | x | | x | | -| rhel-7 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | -| rhel-8 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | -| rhel-9 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | -| rockylinux-8 | | x | | x | | x | | x | | -| rockylinux-9 | | x | | | | x | | x | x | -| sles-12 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | -| sles-13 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | -| solaris-11 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | -| ubuntu-20.04 | | x | x | | | x | | x | x | -| ubuntu-22.04 | | x | | x | | x | | x | | -| ubuntu-23.10 | | | | | | | | | | -| windows-10 | | x | na | | na | x | na | | na | -| windows-11 | | x | na | | na | x | na | | na | -| windows-2016 | | x | na | | na | x | na | | na | -| windows-2019 | | x | na | | na | x | na | | na | -| windows-2022 | | x | na | | na | x | na | | na | +| | hyperv
x86_64 | parallels
x86_64 | parallels
aarch64 | qemu
x86_64 | qemu
aarch64 | virtualbox
x86_64 | virtualbox
aarch64 | vmware
x86_64 | vmware
aarch64 | +|:----------------:|:---:|:-------------------:|:--------------------:|:---:|:---:|:--------------------:|:---:|:-----------------:|:-----------------:| +| almalinux-8 | | x | | x | | x | | x | | +| almalinux-9 | | x | x | | | x | | x | x | +| amazonlinux-2 | | na | na | | | | na | | na | +| amazonlinux-2023 | na | na | na | na | na | na | na | na | na | +| centos-7 | | x | | x | | x | | x | | +| centos-stream-8 | | x | | x | | x | | x | | +| centos-stream-9 | | | x | | | | | | | +| debian-11 | | x | x | | | x | | x | | +| debian-12 | | x | x | | | x | | x | x | +| fedora-38 | | x | | x | | x | | x | x | +| fedora-39 | | | | | | | | | | +| freebsd-13 | | | | | | x | | x | x | +| freebsd-14 | | | | | | x | | x | | +| opensuse-leap-15 | | x | | x | | x | | x | | +| oraclelinux-7 | | x | | x | | x | | x | | +| oraclelinux-8 | | | | x | | x | | x | | +| oraclelinux-9 | | x | x | | | x | | x | | +| rhel-7 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | +| rhel-8 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | +| rhel-9 | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | license
needed | +| rockylinux-8 | | x | | x | | x | | x | | +| rockylinux-9 | | x | | | | x | | x | x | +| sles-12 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | +| sles-13 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | +| solaris-11 | license
needed | license
needed | na | license
needed | na | license
needed | na | license
needed | na | +| ubuntu-20.04 | | x | x | | | x | | x | x | +| ubuntu-22.04 | | x | | x | | x | | x | | +| ubuntu-23.10 | | x | x | | | x | | x | x | +| windows-10 | | x | na | | na | x | na | | na | +| windows-11 | | x | na | | na | x | na | | na | +| windows-2016 | | x | na | | na | x | na | | na | +| windows-2019 | | x | na | | na | x | na | | na | +| windows-2022 | | x | na | | na | x | na | | na | ### Todo @@ -54,7 +54,14 @@ Markdown table generated at - 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-01) +## [unreleased] (2024-02-05) + +## [v4.0.0] (2024-02-05) + +- Added Vagrant Cloud architecture flags so amd64 and arm64 boxes can live under the same cloud box +- Setting amd64 as default architecture for uploads, configurable in the builds.yml file +- Update descriptions mentioning chef to progress chef +- Update README.md to reflect vagrant version for new architecture support ## [v3.2.2] (2024-02-01) diff --git a/README.md b/README.md index 5daaa8919..5a9038a61 100644 --- a/README.md +++ b/README.md @@ -4,6 +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 - 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 @@ -28,17 +29,18 @@ end #### Requirements - [Packer](https://www.packer.io/) >= 1.7.0 -- [Vagrant](https://www.vagrantup.com/) +- [Vagrant](https://www.vagrantup.com/) >= 2.4.0 - At least one of the following virtualization providers: - - [VirtualBox](https://www.virtualbox.org/) - - [VMware Fusion](https://www.vmware.com/products/fusion.html) - - [VMware Workstation](https://www.vmware.com/products/workstation-pro.html) - - [Parallels Desktop Pro](https://www.parallels.com/products/desktop/)*2 also requires [Parallels Virtualization SDK](https://www.parallels.com/products/desktop/download/) for versions < 19.x - - [qemu](https://www.qemu.org/) *1 - - [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/) *1 + - [VirtualBox](https://www.virtualbox.org/)*2 + - [VMware Fusion](https://www.vmware.com/products/fusion.html)*2 + - [VMware Workstation](https://www.vmware.com/products/workstation-pro.html)*2 + - [Parallels Desktop Pro](https://www.parallels.com/products/desktop/) also requires [Parallels Virtualization SDK](https://www.parallels.com/products/desktop/download/) for versions < 19.x + - [qemu](https://www.qemu.org/) *1 *2 + - [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/) *1 *2 -*1**NOTE:** support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist. -*2**NOTE:** AARCH64 or ARM64 support is only guaranteed through parallels provider. +*1 **NOTE:** support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist. + +*2 **NOTE:** AARCH64 or ARM64 support is a work in progress only guaranteed through parallels and vmware provider. ### Using `bento` executable @@ -196,7 +198,7 @@ These basebox templates were converted from [veewee](https://github.com/jedi4eve - Author: Corey Hemminger ([corey.hemminger@progress.com](mailto:corey.hemminger@progress.com)) ```text -Copyright 2012-2023, Progress Software, Inc. () +Copyright 2012-2024, Progress Software, Inc. () Copyright 2011-2012, Tim Dysinger () Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/builds.yml b/builds.yml index a429f96e8..6f0cd3b65 100644 --- a/builds.yml +++ b/builds.yml @@ -1,6 +1,10 @@ --- vagrant_cloud_account: 'bento' +default_architectures: + - 'x86_64' + - 'amd64' + public: - 'almalinux-8' - 'almalinux-9' @@ -24,28 +28,6 @@ public: - 'ubuntu-20.04' - 'ubuntu-22.04' - 'ubuntu-23.10' - - 'almalinux-8-arm64' - - 'almalinux-9-arm64' - - 'amazon-2-arm64' - - 'amazon-2023-arm64' - - 'centos-7-arm64' - - 'centos-stream-8-arm64' - - 'centos-stream-9-arm64' - - 'debian-11-arm64' - - 'debian-12-arm64' - - 'fedora-38-arm64' - - 'fedora-39-arm64' - - 'freebsd-13-arm64' - - 'freebsd-14-arm64' - - 'opensuse-leap-15-arm64' - - 'oracle-7-arm64' - - 'oracle-8-arm64' - - 'oracle-9-arm64' - - 'rockylinux-8-arm64' - - 'rockylinux-9-arm64' - - 'ubuntu-20.04-arm64' - - 'ubuntu-22.04-arm64' - - 'ubuntu-23.10-arm64' # slug box name: text string from standard box name to match (generally the same) slugs: @@ -63,17 +45,6 @@ slugs: 'oracle-9': 'oracle-9' 'rockylinux-8': 'rockylinux-8' 'rockylinux-9': 'rockylinux-9' - 'almalinux-8-arm64': 'almalinux-8' - 'almalinux-9-arm64': 'almalinux-9' - 'centos-7-arm64': 'centos-7' - 'debian-12-arm64': 'debian-12' - 'debian-11-arm64': 'debian-11' - 'fedora-latest-arm64': 'fedora-39' - 'oracle-7-arm64': 'oracle-7' - 'oracle-8-arm64': 'oracle-8' - 'oracle-9-arm64': 'oracle-9' - 'rockylinux-8-arm64': 'rockylinux-8' - 'rockylinux-9-arm64': 'rockylinux-9' do_not_build: - amazon diff --git a/lib/bento/buildmetadata.rb b/lib/bento/buildmetadata.rb index ecbba79d5..d343686dc 100644 --- a/lib/bento/buildmetadata.rb +++ b/lib/bento/buildmetadata.rb @@ -33,12 +33,7 @@ def read attr_reader :template, :build_timestamp, :override_version, :pkr_cmd def box_basename - temp_name = name.gsub('/', '__').split('-') - if temp_name.last == 'arm64' - temp_name.join('-') - else - (temp_name.first temp_name.size - 1).join('-') - end + name.gsub('/', '__').split('-')[0...-1].join('-') end def git_revision @@ -54,12 +49,7 @@ def merged_vars end def name - arch = merged_vars.fetch('arch', UNKNOWN).downcase - if arch == 'aarch64' || arch == 'arm64' - "#{merged_vars.fetch('name', template)}-arm64" - else - "#{merged_vars.fetch('name', template)}-x86_64" - end + merged_vars.fetch('name', template) end def arch diff --git a/lib/bento/cli.rb b/lib/bento/cli.rb index 5b44ae3ce..0727465e4 100644 --- a/lib/bento/cli.rb +++ b/lib/bento/cli.rb @@ -6,6 +6,7 @@ require 'bento/normalize' require 'bento/test' require 'bento/upload' +require 'bento/version' class Options NAME = File.basename($PROGRAM_NAME).freeze @@ -33,6 +34,7 @@ def self.parse(args) normalize : normalize one or more templates test : test one or more builds with kitchen upload : upload and release one or more builds to Vagrant Cloud + version : prints the version of #{NAME} COMMANDS end @@ -59,6 +61,13 @@ def self.parse(args) exit(0) }, }, + version: { + parser: OptionParser.new {}, + argv: proc { |_opts| + puts Bento::VERSION + exit(0) + }, + }, build: { class: BuildRunner, parser: OptionParser.new do |opts| diff --git a/lib/bento/runner.rb b/lib/bento/runner.rb index f1f170046..9c3331622 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' + @only = opts.only ||= 'parallels-iso.vm,virtualbox-iso.vm,vmware-iso.vm,qemu.vm' @except = opts.except @mirror = opts.mirror @headed = opts.headed ||= false @@ -64,8 +64,8 @@ def build(file) time = Benchmark.measure do cmd.run_command end - if Dir.glob("../../builds/*.box").empty? - banner("Not writing metadata file since no boxes exist") + if Dir.glob("../../builds/#{template.split('-')[0...-1].join('-')}*-#{template.split('-')[-1]}.*.box").empty? + banner('Not writing metadata file since no boxes exist') else write_final_metadata(template, time.real.ceil) end diff --git a/lib/bento/upload.rb b/lib/bento/upload.rb index 56863406b..d9c5699ca 100644 --- a/lib/bento/upload.rb +++ b/lib/bento/upload.rb @@ -46,7 +46,7 @@ def upload_box(md_file) 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}...") - upload_cmd = "vagrant cloud publish --architecture #{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'])}" + 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']) @@ -75,11 +75,7 @@ def upload_box(md_file) # def lookup_slug(name) builds_yml['slugs'].each_pair do |slug, match_string| - if name.include?('arm64') - return slug if name.start_with?(match_string) && slug.include?('arm64') - else - return slug if name.start_with?(match_string) && !slug.include?('arm64') - end + return slug if name.start_with?(match_string) end nil @@ -87,21 +83,24 @@ def lookup_slug(name) def public_private_box(name) builds_yml['public'].each do |public| - if name.include?('arm64') || name.include?('aarch64') - return '--no-private' if name.start_with?(public) && public.include?('arm64') - else - return '--no-private' if name.start_with?(public) && !public.include?('arm64') - end + return '--no-private' if name.start_with?(public) + end + '--private' + end + + def default_arch(architecture) + builds_yml['default_architectures'].each do |arch| + return '--default-architecture' if architecture.eql?(arch) end - return '--private' + '--no-default-architecture' end def box_desc(name) - "Vanilla #{name.tr('-', ' ').capitalize} Vagrant box created with Bento by Chef" + "Vanilla #{name.tr('-', ' ').capitalize} Vagrant box created with Bento by Progress Chef" end def slug_desc(name) - "Vanilla #{name.tr('-', ' ').capitalize} Vagrant box created with Bento by Chef. This box will be updated with the latest releases of #{name.tr('-', ' ').capitalize} as they become available" + "Vanilla #{name.tr('-', ' ').capitalize} Vagrant box created with Bento by Progress Chef. This box will be updated with the latest releases of #{name.tr('-', ' ').capitalize} as they become available" end def ver_desc(md_data) @@ -120,6 +119,6 @@ def ver_desc(md_data) tool_versions.sort! tool_versions << "packer: #{md_data['packer']}" - "#{md_data['box_basename'].capitalize.tr('-', ' ')} Vagrant box version #{md_data['version']} created with Bento by Chef. Built with: #{tool_versions.join(', ')}" + "#{md_data['box_basename'].capitalize.tr('-', ' ')} Vagrant box version #{md_data['version']} created with Bento by Progress Chef. Built with: #{tool_versions.join(', ')}" end end diff --git a/lib/bento/version.rb b/lib/bento/version.rb index 40b214786..afc40757d 100644 --- a/lib/bento/version.rb +++ b/lib/bento/version.rb @@ -1,3 +1,3 @@ module Bento - VERSION = '3.2.2'.freeze + VERSION = '4.0.0'.freeze end diff --git a/packer_templates/http/springdalelinux/7ks.cfg b/packer_templates/http/springdalelinux/7ks.cfg deleted file mode 100644 index bef5e9bd7..000000000 --- a/packer_templates/http/springdalelinux/7ks.cfg +++ /dev/null @@ -1,81 +0,0 @@ -install -eula --agreed -url --url="http://springdale.princeton.edu/data/Springdale/7/x86_64/os" -repo --name="Addons" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Addons -repo --name="Computational" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Computational -repo --name="Updates" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Updates -lang en_US.UTF-8 -keyboard us -network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 -rootpw --plaintext vagrant -firewall --disabled -selinux --permissive -timezone UTC -bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" -text -skipx -zerombr -clearpart --all --initlabel -autopart --type=plain -firstboot --disabled -reboot --eject -user --name=vagrant --plaintext --password vagrant - -%packages --ignoremissing --excludedocs -@core -openssh-clients -sudo -selinux-policy-devel -wget -nfs-utils -net-tools -tar -bzip2 -deltarpm -rsync -dnf-utils -redhat-lsb-core -elfutils-libelf-devel -network-scripts --fprintd-pam --intltool --iwl*-firmware --microcode_ctl -%end - -%post -# sudo -echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant -echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant -chmod 440 /etc/sudoers.d/vagrant - -# Enable hyper-v daemons only if using hyper-v virtualization -if [ $(virt-what) == "hyperv" ]; then -dnf -y install hyperv-daemons cifs-utils -systemctl enable hypervvssd -systemctl enable hypervkvpd -fi - -# Since we disable consistent network naming, we need to make sure the eth0 -# configuration file is in place so it will come up. -# Delete other network configuration first because RHEL/C7 networking will not -# restart successfully if there are configuration files for devices that do not -# exist. -rm -f /etc/sysconfig/network-scripts/ifcfg-e* -cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ -TYPE=Ethernet -PROXY_METHOD=none - BROWSER_ONLY=no - BOOTPROTO=dhcp - DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes - IPV6_FAILURE_FATAL=no - IPV6_ADDR_GEN_MODE=stable-privacy - NAME=eth0 -DEVICE=eth0 -ONBOOT=yes -_EOF_ -%end diff --git a/packer_templates/http/springdalelinux/8ks.cfg b/packer_templates/http/springdalelinux/8ks.cfg deleted file mode 100644 index 9209acbaf..000000000 --- a/packer_templates/http/springdalelinux/8ks.cfg +++ /dev/null @@ -1,84 +0,0 @@ -install -url --url="http://springdale.princeton.edu/data/Springdale/8/x86_64/os" -lang en_US.UTF-8 -keyboard us -network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 -rootpw --plaintext vagrant -firewall --disabled -selinux --permissive -timezone UTC -bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" -text -skipx -zerombr -clearpart --all --initlabel -autopart --nohome --nolvm --noboot -firstboot --disabled -reboot --eject -user --name=vagrant --plaintext --password vagrant - -%packages --ignoremissing --excludedocs --instLangs=en_US.utf8 -# maybe prb needed for vbos guest additions? https://github.com/chef/bento/issues/1345 -# kernel-devel -# gcc -# make -# perl -# elfutils-libelf-devel -# end vbox -# vagrant needs this to copy initial files via scp -openssh-clients -sudo -selinux-policy-devel -wget -nfs-utils -net-tools -tar -bzip2 -deltarpm -rsync -dnf-utils -redhat-lsb-core -elfutils-libelf-devel -network-scripts --fprintd-pam --intltool --iwl*-firmware --microcode_ctl -%end - -%post -# sudo -echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant -echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant -chmod 440 /etc/sudoers.d/vagrant - -# Enable hyper-v daemons only if using hyper-v virtualization -if [ $(virt-what) == "hyperv" ]; then -dnf -y install hyperv-daemons cifs-utils -systemctl enable hypervvssd -systemctl enable hypervkvpd -fi - -# Since we disable consistent network naming, we need to make sure the eth0 -# configuration file is in place so it will come up. -# Delete other network configuration first because RHEL/C7 networking will not -# restart successfully if there are configuration files for devices that do not -# exist. -rm -f /etc/sysconfig/network-scripts/ifcfg-e* -cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ -TYPE=Ethernet -PROXY_METHOD=none - BROWSER_ONLY=no - BOOTPROTO=dhcp - DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes - IPV6_FAILURE_FATAL=no - IPV6_ADDR_GEN_MODE=stable-privacy - NAME=eth0 -DEVICE=eth0 -ONBOOT=yes -_EOF_ -%end diff --git a/packer_templates/http/springdalelinux/9ks.cfg b/packer_templates/http/springdalelinux/9ks.cfg deleted file mode 100644 index 8f2523d42..000000000 --- a/packer_templates/http/springdalelinux/9ks.cfg +++ /dev/null @@ -1,82 +0,0 @@ -# Kickstart file for springdalelinux 9 -lang en_US.UTF-8 -keyboard us -network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 -rootpw --plaintext vagrant -firewall --disabled -selinux --permissive -timezone UTC -bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" -text -skipx -zerombr -clearpart --all --initlabel -autopart --nohome --nolvm --noboot -firstboot --disabled -reboot --eject -user --name=vagrant --plaintext --password vagrant - -url --url="http://springdale.princeton.edu/data/springdale/9/x86_64/os" -repo --name="BaseOS" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/BaseOS -repo --name="Updates_BaseOS" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/Updates_BaseOS -repo --name="AppStream" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/AppStream -repo --name="Updates_AppStream" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/Updates_AppStream - -%packages --ignoremissing --excludedocs -@^server-product-environment -openssh-clients -sudo -selinux-policy-devel -wget -nfs-utils -net-tools -tar -bzip2 -deltarpm -rsync -dnf-utils -redhat-lsb-core -elfutils-libelf-devel -network-scripts --fprintd-pam --intltool --iwl*-firmware --microcode_ctl -%end - -%post -# sudo -echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant -echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant -chmod 440 /etc/sudoers.d/vagrant - -# Enable hyper-v daemons only if using hyper-v virtualization -if [ $(virt-what) == "hyperv" ]; then -dnf -y install hyperv-daemons cifs-utils -systemctl enable hypervvssd -systemctl enable hypervkvpd -fi - -# Since we disable consistent network naming, we need to make sure the eth0 -# configuration file is in place so it will come up. -# Delete other network configuration first because RHEL/C7 networking will not -# restart successfully if there are configuration files for devices that do not -# exist. -rm -f /etc/sysconfig/network-scripts/ifcfg-e* -cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ -TYPE=Ethernet -PROXY_METHOD=none - BROWSER_ONLY=no - BOOTPROTO=dhcp - DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes - IPV6_FAILURE_FATAL=no - IPV6_ADDR_GEN_MODE=stable-privacy - NAME=eth0 -DEVICE=eth0 -ONBOOT=yes -_EOF_ -%end diff --git a/packer_templates/http/ubuntu/user-data b/packer_templates/http/ubuntu/user-data index 01a91e224..17f05ca0a 100644 --- a/packer_templates/http/ubuntu/user-data +++ b/packer_templates/http/ubuntu/user-data @@ -13,6 +13,6 @@ autoinstall: install-server: yes allow-pw: yes late-commands: - - echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant - # Enable hyper-v daemons only if using hyper-v virtualization - - if [ $(virt-what) == "hyperv" ]; then apt-get update && apt-get install -y hyperv-daemons linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils && systemctl enable hypervvssd && systemctl enable hypervkvpd && systemctl start hypervvssd && systemctl start hypervkvpd; fi + - echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant + # Enable hyper-v daemons only if using hyper-v virtualization + - if [ $(virt-what) == "hyperv" ]; then apt-get update && apt-get install -y hyperv-daemons linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils && systemctl enable hypervvssd && systemctl enable hypervkvpd && systemctl start hypervvssd && systemctl start hypervkvpd; fi