packer/ubuntu24/http/user-data

47 lines
850 B
Plaintext
Raw Permalink Normal View History

2024-07-15 14:58:32 +02:00
#cloud-config
autoinstall:
version: 1
locale: en_US
keyboard:
layout: us
storage:
layout:
name: lvm
network:
version: 2
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
# packer user
identity:
hostname: packer
username: packer
password: "$6$WUe8MQLrLReDtp7S$cz5dzvQ8CZjL1.YvT7xMvyqC6DJ.vIkCJJHgkuRIS/LICSw.pqA0LgRh/rMUiv.UXZl.IMBIrDAhC.CzG.ASa1"
# enable ssh
ssh:
install-server: yes
allow-pw: yes
# create root account
user-data:
disable_root: false
# install qemu guest agent
packages:
- curl
- qemu-guest-agent
- sudo
- wget
# allow ubuntu user pwless sudo
late-commands:
- echo 'packer ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/packer