Skip to content

Instantly share code, notes, and snippets.

@colobas
Created November 24, 2021 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colobas/1332890eda34b7122d66bb9920e74a5d to your computer and use it in GitHub Desktop.
Save colobas/1332890eda34b7122d66bb9920e74a5d to your computer and use it in GitHub Desktop.
#cloud-config
autoinstall:
version: 1
early-commands:
- systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
network:
network:
version: 2
ethernets:
eth0:
dhcp4: yes
dhcp-identifier: mac
apt:
preserve_sources_list: false
primary:
- arches: [amd64]
uri: "http://archive.ubuntu.com/ubuntu/"
ssh:
install-server: yes
authorized-keys:
- "your SSH pub key here"
allow-pw: no
identity:
hostname: ubuntu-00
password: "$6$FhcddHFVZ7ABA4Gi$9l4yURWASWe8xEa1jzI0bacVLvhe3Yn4/G3AnU11K3X0yu/mICVRxfo6tZTB2noKljlIRzjkVZPocdf63MtzC0" # root
username: ubuntu # root doesn't work
packages:
- open-vm-tools
user-data:
disable_root: false
late-commands:
- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
- sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub
- curtin in-target --target /target update-grub2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment