From bbeee7b184366f63be05b3b8c425b07d25ec859d Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sun, 26 Apr 2020 16:00:34 -0500 Subject: [PATCH] Add support for Ubuntu 20.04 Changes based on updates from https://github.com/chef/bento/issues/1281#issuecomment-619618393 Signed-off-by: Joe Ferguson --- .../ubuntu/ubuntu-20.04-amd64.json | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 packer_templates/ubuntu/ubuntu-20.04-amd64.json diff --git a/packer_templates/ubuntu/ubuntu-20.04-amd64.json b/packer_templates/ubuntu/ubuntu-20.04-amd64.json new file mode 100644 index 000000000..254447e6b --- /dev/null +++ b/packer_templates/ubuntu/ubuntu-20.04-amd64.json @@ -0,0 +1,288 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_additions_url": "{{ user `guest_additions_url` }}", + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "Ubuntu_64", + "hard_drive_interface": "sata", + "headless": "{{ user `headless` }}", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-virtualbox", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_timeout": "10000s", + "type": "virtualbox-iso", + "memory": "{{ user `memory` }}", + "cpus": "{{ user `cpus` }}", + "virtualbox_version_file": ".vbox_version", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_os_type": "ubuntu-64", + "headless": "{{ user `headless` }}", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-vmware", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_timeout": "10000s", + "tools_upload_flavor": "linux", + "type": "vmware-iso", + "vm_name": "{{ user `template` }}", + "memory": "{{ user `memory` }}", + "cpus": "{{ user `cpus` }}", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "ethernet0.pciSlotNumber": "32" + }, + "vmx_remove_ethernet_interfaces": true + }, + { + "boot_command": [ + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_os_type": "ubuntu", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-parallels", + "parallels_tools_flavor": "lin", + "memory": "{{ user `memory` }}", + "cpus": "{{ user `cpus` }}", + "prlctl_version_file": ".prlctl_version", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_timeout": "10000s", + "type": "parallels-iso", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/vda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "headless": "{{ user `headless` }}", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-qemu", + "memory": "{{ user `memory` }}", + "cpus": "{{ user `cpus` }}", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_timeout": "10000s", + "type": "qemu", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "set gfxpayload=1024x768", + "linux /install/vmlinuz ", + "preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed-hyperv.cfg ", + "debian-installer=en_US.UTF-8 auto locale=en_US.UTF-8 kbd-chooser/method=us ", + "hostname={{.Name}} ", + "fb=false debconf/frontend=noninteractive ", + "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA console-setup/ask_detect=false ", + "initrd /install/initrd.gz", + "boot" + ], + "boot_wait": "10s", + "communicator": "ssh", + "cpus": "{{ user `cpus` }}", + "disk_size": "{{user `disk_size`}}", + "enable_secure_boot": false, + "generation": "{{user `hyperv_generation`}}", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "memory": "{{user `memory`}}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-hyperv", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_timeout": "10000s", + "ssh_username": "vagrant", + "switch_name": "{{user `hyperv_switch`}}", + "type": "hyperv-iso", + "vm_name": "{{ user `template` }}" + } + ], + "post-processors": [ + { + "output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'", + "expect_disconnect": true, + "scripts": [ + "{{template_dir}}/scripts/update.sh", + "{{template_dir}}/../_common/motd.sh", + "{{template_dir}}/../_common/sshd.sh", + "{{template_dir}}/scripts/networking.sh", + "{{template_dir}}/scripts/sudoers.sh", + "{{template_dir}}/scripts/vagrant.sh", + "{{template_dir}}/../_common/virtualbox.sh", + "{{template_dir}}/scripts/vmware.sh", + "{{template_dir}}/../_common/parallels.sh", + "{{template_dir}}/scripts/hyperv.sh", + "{{template_dir}}/scripts/cleanup.sh", + "{{template_dir}}/../_common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "box_basename": "ubuntu-20.04", + "build_directory": "../../builds", + "http_directory": "{{template_dir}}/http", + "build_timestamp": "{{isotime \"20060102150405\"}}", + "cpus": "1", + "disk_size": "65536", + "git_revision": "__unknown_git_revision__", + "headless": "", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "hyperv_generation": "2", + "hyperv_switch": "{{env `hyperv_switch`}}", + "guest_additions_url": "", + "iso_checksum": "36f15879bd9dfd061cd588620a164a82972663fdd148cce1f70d57d314c21b73", + "iso_checksum_type": "sha256", + "iso_name": "ubuntu-20.04-legacy-server-amd64.iso", + "memory": "1024", + "mirror": "http://cdimage.ubuntu.com", + "mirror_directory": "ubuntu-legacy-server/releases/20.04/release", + "name": "ubuntu-20.04", + "no_proxy": "{{env `no_proxy`}}", + "preseed_path": "preseed.cfg", + "template": "ubuntu-20.04-amd64", + "version": "TIMESTAMP" + } +}