├── http ├── meta-data └── user-data ├── .gitignore ├── README.md ├── ubuntu-2004.json └── LICENSE /http/meta-data: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | packer_cache/ 2 | -------------------------------------------------------------------------------- /http/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | early-commands: 5 | - systemctl stop ssh 6 | identity: 7 | hostname: ubuntu-server 8 | password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1' 9 | username: ubuntu 10 | network: 11 | network: 12 | version: 2 13 | ethernets: 14 | ens33: {dhcp4: true, dhcp-identifier: mac} 15 | ssh: 16 | install-server: true 17 | late-commands: 18 | - sed -i 's/^#*\(send dhcp-client-identifier\).*$/\1 = hardware;/' /target/etc/dhcp/dhclient.conf 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # packer-ubuntu-2004 2 | 3 | An example [Packer][] template for building Ubuntu 20.04 LTS (Focal 4 | Fossa). Ubuntu 20.04 brings with it a new installer, replacing the previous 5 | [Debian installer][1] with [`subiquity`][2]. 6 | 7 | This is the companion example to my notes on doing this, [_Automating Ubuntu 8 | 20.04 installs with Packer_][3]. 9 | 10 | ## Usage 11 | 12 | ```sh 13 | packer build ubuntu-2004.json 14 | ``` 15 | 16 | ## Author 17 | 18 | Copyright (c) 2020 Nick Charlton. MIT Licensed. 19 | 20 | [Packer]: https://packer.io 21 | [1]: https://www.debian.org/devel/debian-installer/ 22 | [2]: https://github.com/CanonicalLtd/subiquity 23 | [3]: https://nickcharlton.net/posts/automating-ubuntu-2004-installs-with-packer.html 24 | -------------------------------------------------------------------------------- /ubuntu-2004.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "name": "ubuntu-2004", 5 | "type": "vmware-iso", 6 | "guest_os_type": "ubuntu-64", 7 | "headless": false, 8 | 9 | "iso_url": "http://releases.ubuntu.com/20.04/ubuntu-20.04.2-live-server-amd64.iso", 10 | "iso_checksum": "sha256:d1f2bf834bbe9bb43faf16f9be992a6f3935e65be0edece1dee2aa6eb1767423", 11 | 12 | "ssh_username": "ubuntu", 13 | "ssh_password": "ubuntu", 14 | "ssh_timeout": "30m", 15 | 16 | "http_directory": "http", 17 | 18 | "memory": 1024, 19 | 20 | "boot_wait": "5s", 21 | "boot_command": [ 22 | " ", 23 | "autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/", 24 | "" 25 | ] 26 | } 27 | ], 28 | 29 | "provisioners": [ 30 | { 31 | "type": "shell", 32 | "inline": ["ls /"] 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Nick Charlton 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | --------------------------------------------------------------------------------