Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/release/tools/ec2-cloud-init.conf
103009 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
# Hack for FreeBSD 15.0; should go away before 15.1.
13
MISSING_METALOGS="
14
./usr/local/etc/cloud/cloud.cfg
15
./usr/local/etc/cloud/cloud.cfg.d/05_logging.cfg
16
./usr/local/etc/cloud/cloud.cfg.d/99_freebsd.cfg
17
./usr/local/etc/pam.d/sudo
18
./usr/local/etc/ssl/cert.pem
19
./usr/local/etc/sudo.conf
20
./usr/local/etc/sudo_logsrvd.conf
21
./usr/local/etc/sudoers
22
"
23
24
vm_extra_pre_umount() {
25
# Configuration common to all EC2 AMIs
26
ec2_common
27
28
# Configure cloud-init
29
cat <<-'EOF' > ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg
30
disable_root: true
31
system_info:
32
distro: freebsd
33
default_user:
34
name: ec2-user
35
lock_passwd: True
36
groups: [wheel]
37
shell: /bin/sh
38
homedir: /home/ec2-user
39
doas:
40
- permit nopass ec2-user
41
EOF
42
metalog_add_data ./usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg
43
44
return 0
45
}
46
47