From 016d4d13a717c2ba156360319f6b8b47019e14a9 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sun, 2 Jul 2023 07:55:09 +0000 Subject: [PATCH] 2 --- build.sh | 8 +++++++- seed/meta-data | 2 ++ seed/user-data | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 seed/meta-data create mode 100644 seed/user-data diff --git a/build.sh b/build.sh index 986c985..9062423 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash +export DEBIAN_FRONTEND=noninteractive + # install ubuntu dependenices for image building apt update -apt install -y libvirt-daemon qemu-utils qemu wget +apt install -y libvirt-daemon qemu-utils qemu wget genisoimage wget https://raw.githubusercontent.com/alpinelinux/alpine-make-vm-image/master/alpine-make-vm-image -O alpine-make-vm-image chmod +x alpine-make-vm-image @@ -21,3 +23,7 @@ DISK_SIZE="20G" IMAGE_FORMAT="qcow2" bash alpine-make-vm-image -b ${ALPINE_BRANCH} -p "$( cat ${PACKAGES_FILE} | xargs) " -s ${DISK_SIZE} -f ${IMAGE_FORMAT} ${IMAGES_FILENAME} --script-chroot ${INIT_SCRIPT} + +cd seed +mkisofs -output ../alpine-cloud-init-data.iso -volid cidata -joliet -rock user-data meta-data +cd - diff --git a/seed/meta-data b/seed/meta-data new file mode 100644 index 0000000..77da86d --- /dev/null +++ b/seed/meta-data @@ -0,0 +1,2 @@ +instance-id: iid-local01 +local-hostname: cloudimg diff --git a/seed/user-data b/seed/user-data new file mode 100644 index 0000000..9d4107f --- /dev/null +++ b/seed/user-data @@ -0,0 +1,4 @@ +#cloud-config +password: passw0rd +chpasswd: { expire: False } +ssh_pwauth: True