Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/release/tools/ec2-cloud-init.conf
34677 views
1
#!/bin/sh
2
3
. ${WORLDDIR}/release/tools/ec2.conf
4
5
# Packages to install into the image we're creating. In addition to packages
6
# present on all EC2 AMIs, we install amazon-ssm-agent and cloud-init.
7
export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent net/cloud-init"
8
9
# Services to enable in rc.conf(5).
10
export VM_RC_LIST="${VM_RC_LIST} cloudinit sshd"
11
12
vm_extra_pre_umount() {
13
# Configuration common to all EC2 AMIs
14
ec2_common
15
16
# Configure cloud-init
17
cat <<-'EOF' > ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg
18
disable_root: true
19
system_info:
20
distro: freebsd
21
default_user:
22
name: ec2-user
23
lock_passwd: True
24
groups: [wheel]
25
shell: /bin/sh
26
homedir: /home/ec2-user
27
doas:
28
- permit nopass ec2-user
29
EOF
30
31
return 0
32
}
33
34