feat(recipe): adding alpine 3.17 version

This commit is contained in:
Philippe Caseiro 2022-12-28 09:51:38 +01:00
parent 632c4cd517
commit 214a84994c
17 changed files with 45 additions and 75 deletions

View File

@ -0,0 +1,6 @@
name = "alpine"
version = "3.17.0"
short_version = "3.17"
arch = "x86_64"
source_url = "https://dl-cdn.alpinelinux.org/alpine"
iso_cd_checksum = "8d4d53bd34b2045e1e219b87887b0de8d217b6cd4a8b476a077429845a5582ba"

View File

@ -42,7 +42,7 @@ EOF
content = "${jsonencode(local.Kubernetes)}" content = "${jsonencode(local.Kubernetes)}"
} }
// Copy habor OpenRC init script to the image // Copy Sharemetrics script
provisioner "file" { provisioner "file" {
destination = "/etc/local.d/sharemetrics.start" destination = "/etc/local.d/sharemetrics.start"
source = "${local.locations.provisionning}/conf/${build.name}/sharemetrics.start" source = "${local.locations.provisionning}/conf/${build.name}/sharemetrics.start"

View File

@ -28,7 +28,7 @@ locals {
AlpineEdgeTesting = { AlpineEdgeTesting = {
type = "apk" type = "apk"
name = "testing" name = "testing"
url = "http://mirror.serverion.com/alpine/edge/testing" url = "http://mirrors.ircam.fr/pub/alpine/edge/testing"
enabled = true enabled = true
} }
} }

View File

@ -42,6 +42,12 @@ EOF
content = "${jsonencode(local.MatchBox)}" content = "${jsonencode(local.MatchBox)}"
} }
// Copy matchbox boot provisionning script
provisioner "file" {
destination = "/etc/local.d/initmatchbox.start"
source = "${local.locations.provisionning}/conf/${build.name}/initmatchbox.start"
}
// Generate default configuration for kubernetes // Generate default configuration for kubernetes
provisioner "shell" { provisioner "shell" {
max_retries = 3 max_retries = 3
@ -77,7 +83,7 @@ EOF
post-processor "shell-local" { post-processor "shell-local" {
inline = [ inline = [
"/bin/sh ${path.cwd}/post-processors/sparsify.sh ${var.output_dir}/${var.version}/provisionned/matchbox ${var.image_version}", "/bin/sh ${path.cwd}/post-processors/sparsify.sh ${var.output_dir}/${var.version}/provisionned/matchbox ${var.image_version}",
"ruby ${local.dirs.tools}/one-templates -t image -m 640 -T ${local.dirs.templates}/one/image/common.tpl -n ${local.output_name}-${var.version}-matchbox -c 'matchbox base image' --image-file ${var.output_dir}/${var.version}/provisionned/matchbox/${local.output_name}-${var.version}-matchbox.img", "ruby ${local.dirs.tools}/one-templates -t image -m 640 -T ${local.dirs.templates}/one/image/common.tpl -n ${local.output_name}-${var.version}-matchbox -c 'Matchbox base image' --image-file ${var.output_dir}/${var.version}/provisionned/matchbox/${local.output_name}-${var.version}-matchbox.img",
"ruby ${local.dirs.tools}/one-templates -t vm -m 640 -T ${local.dirs.templates}/one/vm/matchbox.xml -n ${local.output_name}-${var.version}-matchbox --image-name ${local.output_name}-${var.version}-matchbox" "ruby ${local.dirs.tools}/one-templates -t vm -m 640 -T ${local.dirs.templates}/one/vm/matchbox.xml -n ${local.output_name}-${var.version}-matchbox --image-name ${local.output_name}-${var.version}-matchbox"
] ]
} }

View File

@ -2,7 +2,7 @@
set -xeo pipefail set -xeo pipefail
# Run the installer # Run the installer
echo "y" | setup-alpine -e -f install.conf yes | setup-alpine -e -f install.conf
# Copy ssh keys # Copy ssh keys
echo "Copy packer ssh key" echo "Copy packer ssh key"
@ -11,5 +11,8 @@ cp -rp .ssh /mnt/root/
sync sync
umount /mnt umount /mnt
apk update
apk add curl
echo "Rebooting the host after install" echo "Rebooting the host after install"
reboot reboot

View File

@ -0,0 +1 @@
alpine-3.16-install.sh

View File

@ -0,0 +1 @@
alpine-3.16-postinstall.sh

View File

@ -0,0 +1,19 @@
#!/bin/sh
FL_VERSIONS="current 3374.2.0"
MATCHBOX_DIR="/var/lib/matchbox"
ASSETS_DIR="${MATCHBOX_DIR}/assets/"
echo "Provisionning matchbox with flatcar images"
echo " * Current stable image (try 1)"
for version in ${FL_VERSIONS}; do
while ! bash -x /usr/local/bin/get-flatcar stable ${version} ${ASSETS_DIR}; do
sleep 1
echo " * ${version} stable image (try ${item})"
if [ "${tout}" -eq "${item}" ]; then
break
exit 1
fi
item=$((item+1))
done
done

View File

@ -10,6 +10,8 @@ ASSETS_DIR="${MATCHBOX_DIR}/assets/"
MATCHBOX_USER="matchbox" MATCHBOX_USER="matchbox"
FL_VERSIONS="current 3374.2.0" FL_VERSIONS="current 3374.2.0"
apk add wget
echo "Downloading matchbox" echo "Downloading matchbox"
cd /tmp cd /tmp
wget -q --show-progress "${URL}" wget -q --show-progress "${URL}"
@ -28,33 +30,6 @@ mkdir -p "${ASSETS_DIR}"
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${MATCHBOX_DIR}" chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${MATCHBOX_DIR}"
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}" chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
tout=30 cp -rp ./scripts/tls /root/.secrets
item=1
echo "Provisionning matchbox with flatcar images"
echo " * Current stable image (try 1)"
for version in ${FL_VERSIONS}; do
while ! bash -x /usr/local/bin/get-flatcar stable ${version} ${ASSETS_DIR}; do
sleep 1
echo " * ${version} stable image (try ${item})"
if [ "${tout}" -eq "${item}" ]; then
break
exit 1
fi
item=$((item+1))
done
done
echo " * 3374.2.0 stable image (try 1)"
get-flatcar stable 3374.2.0 "${ASSETS_DIR}"
if [ "${?}" -ne 0 ]; then
sleep 3
echo " * 3374.2.0 stable image (try 2)"
get-flatcar stable 3374.2.0 "${ASSETS_DIR}"
fi
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
ls -lhaR ${ASSETS_DIR}
cp -rp ./scripts/tls /root
exit "${?}" exit "${?}"

View File

@ -15,6 +15,8 @@ installTool() {
chmod +x ${TOOL_DIR}/${NAME} chmod +x ${TOOL_DIR}/${NAME}
} }
apk add curl
# Install templater # Install templater
installTool "tpr" "https://forge.cadoles.com/attachments/bbe5e07f-433c-4f57-ba88-4f86e2780ca7" installTool "tpr" "https://forge.cadoles.com/attachments/bbe5e07f-433c-4f57-ba88-4f86e2780ca7"

View File

@ -1,6 +0,0 @@
user: pcaseiro
token: 3b4ee45f23eda94727745940d85daa173430d3d4
builder_addr: 192.168.10.177
endpoint: https://asgard.cadoles.com
flow_endpoint: https://asgard.cadoles.com/oneflow
datastore_id: 101

View File

@ -1,6 +0,0 @@
user: pcaseiro
token: feb09a5d34ba6beae09e77ade13bfcefb1fb75c1088ac0e041061911ddb89875
builder_addr: 192.168.230.192
endpoint: http://one.eole.lan
flow_endpoint: http://one.eole.lan/oneflow
datastore_id: 101

View File

@ -1,6 +0,0 @@
user: terra
token: c4e249fdae281ce6f8e1c7cc4326996fca4b4c7b
builder_addr: 192.168.10.177
endpoint: https://midgard.cadoles.com
flow_endpoint: https://midgard.cadoles.com/oneflow
datastore_id: 103

View File

@ -1,6 +0,0 @@
user: terra
token: 1cfe1c2b27216b666cf7d7af760e63ccd1630840
builder_addr: 192.168.10.177
endpoint: https://midgard.cadoles.com
flow_endpoint: https://midgard.cadoles.com/oneflow
datastore_id: 103

View File

@ -1,6 +0,0 @@
user: terra
token: a48f776f7bfe1f264d9bc4cbba6babee33c5eca2
builder_addr: 192.168.10.177
endpoint: https://midgard.cadoles.com
flow_endpoint: https://midgard.cadoles.com/oneflow
datastore_id: 103

View File

@ -1,7 +0,0 @@
user: pcaseiro
token: b37911f5ec06589fcf9411958d1ec1bc5fa7f46d5aafb9b1100a9446b1140299
builder_addr: 192.168.10.177
external_url: http://192.168.230.58/images
endpoint: http://one.eole.lan
flow_endpoint: http://one.eole.lan/oneflow
datastore_id: 101

View File

@ -1,6 +0,0 @@
user: eoleone
token: 9a00930f231b58f51e6f42c9faaddb100036897e35f32206b5c1264295c8dc6d
builder_addr: 192.168.10.177
endpoint: https://yggy.cadoles.com
flow_endpoint: https://yggy.cadoles.com/oneflow
datastore_id: 101