#cloud-config
autoinstall:
version: 1
early-commands:
# workaround to stop ssh for packer as it thinks it timed out
- sudo systemctl stop ssh
locale: en_US
keyboard:
layout: en
variant: us
packages: [open-vm-tools, openssh-server, net-tools, perl, open-iscsi, ntp, curl, vim, ifupdown, zip, unzip, gnupg2, software-properties-common, apt-transport-https, ca-certificates, lsb-release, python3-pip, jq, openvpn]
network:
network:
version: 2
ethernets:
ens192:
dhcp4: true
identity:
hostname: ubuntu-server
username: ubuntu
password: test12345
ssh:
install-server: yes
allow-pw: yes
authorized-keys:
- ssh-rsa <public key>
storage:
layout:
name: lvm
user-data:
disable_root: false
late-commands:
- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
- curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/ubuntu
- apt update -y
- apt install cloud-init -y
- apt install openssh-server -y
- apt install nfs-common nfs-kernel-server -y
- cat <<EOF > /etc/resolv.conf
nameserver <nameserver ip>
EOF
- apt install iputils-ping open-vm-tools openssh-server net-tools perl open-iscsi ntp curl vim ifupdown zip unzip gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release python3-pip jq openvpn -y
- service vmtoolsd restart