Add "cloudinit" to Bootstrap Dimension
* cloudinit bootstrap is functional now * remove cloudinit from testing overlay * add e2fsprogs to all images Resolves #100
This commit is contained in:
parent
13ad49f6f3
commit
c9665f68dc
|
@ -62,6 +62,7 @@ Dimensions {
|
|||
}
|
||||
bootstrap {
|
||||
tiny { include required("bootstrap/tiny.conf") }
|
||||
cloudinit { include required("bootstrap/cloudinit.conf") }
|
||||
}
|
||||
cloud {
|
||||
aws { include required("cloud/aws.conf") }
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# vim: ts=2 et:
|
||||
name = [cloudinit]
|
||||
|
||||
packages {
|
||||
cloud-init = true
|
||||
openssh-server-pam = true
|
||||
e2fsprogs-extra = true # for resize2fs
|
||||
}
|
||||
services.default.cloud-init-hotplugd = true
|
||||
|
||||
scripts = [ setup-cloudinit ]
|
|
@ -11,6 +11,7 @@ packages {
|
|||
linux-virt = true
|
||||
alpine-mirrors = true
|
||||
chrony = true
|
||||
e2fsprogs = true
|
||||
openssh = true
|
||||
sudo = true
|
||||
tzdata = true
|
||||
|
|
|
@ -18,10 +18,6 @@ Default {
|
|||
}
|
||||
|
||||
Dimensions {
|
||||
bootstrap {
|
||||
# not quite working yet
|
||||
#cloudinit { include required("testing/cloudinit.conf") }
|
||||
}
|
||||
cloud {
|
||||
# just test in these regions
|
||||
aws.regions {
|
||||
|
@ -32,6 +28,8 @@ Dimensions {
|
|||
#oci { include required("testing/oci.conf") }
|
||||
#gcp { include required("testing/gcp.conf") }
|
||||
#azure { include required("testing/azure.conf") }
|
||||
#generic
|
||||
#nocloud
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# vim: ts=2 et:
|
||||
name = [cloudinit]
|
||||
|
||||
packages {
|
||||
cloud-init = true
|
||||
openssh-server-pam = true
|
||||
}
|
||||
scripts = [ setup-cloudinit ]
|
||||
script_dirs = [ setup-cloudinit.d ]
|
|
@ -4,12 +4,7 @@
|
|||
[ -z "$DEBUG" ] || [ "$DEBUG" = 0 ] || set -x
|
||||
|
||||
TARGET=/mnt
|
||||
#SETUP=/tmp/setup-cloudinit.d
|
||||
|
||||
die() {
|
||||
printf '\033[1;7;31m FATAL: %s \033[0m\n' "$@" >&2 # bold reversed red
|
||||
exit 1
|
||||
}
|
||||
einfo() {
|
||||
printf '\n\033[1;7;36m> %s <\033[0m\n' "$@" >&2 # bold reversed cyan
|
||||
}
|
||||
|
@ -25,3 +20,17 @@ chroot "$TARGET" /sbin/setup-cloud-init
|
|||
if [ -f "$TARGET"/etc/cloud/cloud.cfg ]; then
|
||||
sed -i '/lock_passwd:/s/True/False/' "$TARGET"/etc/cloud/cloud.cfg
|
||||
fi
|
||||
|
||||
# configure the image for a particular cloud datasource
|
||||
case "$CLOUD" in
|
||||
aws)
|
||||
DATASOURCE="Ec2"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported Cloud '$CLOUD'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
printf '\n\n# Cloud-Init will use default configuration for this DataSource\n'
|
||||
printf 'datasource_list: ["%s"]\n' "$DATASOURCE" >> "$TARGET"/etc/cloud/cloud.cfg
|
Loading…
Reference in New Issue