freebsd-src/release/tools/ec2-cloud-init.conf
Mina Galić 2039437c76 ec2: homedir bug fixed in 24.1.4
This bug fix is due to be released in Quarterly:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275896

While here, overwrite the `doas` stanza, which needs to correspond to
the user that we are creating.

MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1163
2024-04-11 14:12:16 -07:00

33 lines
751 B
Bash

#!/bin/sh
. ${WORLDDIR}/release/tools/ec2.conf
# Packages to install into the image we're creating. In addition to packages
# present on all EC2 AMIs, we install cloud-init.
export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} net/cloud-init"
# Services to enable in rc.conf(5).
export VM_RC_LIST="${VM_RC_LIST} cloudinit sshd"
vm_extra_pre_umount() {
# Configuration common to all EC2 AMIs
ec2_common
# Configure cloud-init
cat <<-'EOF' > ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg
disable_root: true
system_info:
distro: freebsd
default_user:
name: ec2-user
lock_passwd: True
groups: [wheel]
shell: /bin/sh
homedir: /home/ec2-user
doas:
- permit nopass ec2-user
EOF
return 0
}