Skip to content

Instantly share code, notes, and snippets.

@freyes
Last active May 16, 2019 15:14
Show Gist options
  • Save freyes/b4a3d937e13091416278190afa42bf00 to your computer and use it in GitHub Desktop.
Save freyes/b4a3d937e13091416278190afa42bf00 to your computer and use it in GitHub Desktop.
sync v2 and v3 images in a under ~/public_html/maas/... , remember to configure some http server to serve them
# Default server configuration /etc/nginx/sites-enabled/default
#
server {
listen 80 default_server;
listen [::]:80 default_server;
...
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/public_html$2;
index index.html index.htm;
autoindex on;
}
}
#!/bin/bash -ex
which sstream-mirror || (echo "please install simplestreams first" && exit 1)
KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
IMAGE_SRC=https://images.maas.io/ephemeral-v3/daily/
IMAGE_DIR=~/public_html/maas/images/ephemeral-v3/daily
mkdir -p $IMAGE_DIR
sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR \
'arch=amd64' 'release~(trusty|xenial|bionic)' --max=1 --progress
sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR \
'os~(grub*|pxelinux)' --max=1 --progress
KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
IMAGE_SRC=https://images.maas.io/ephemeral-v2/daily/
IMAGE_DIR=~/public_html/maas/images/ephemeral-v2/daily
mkdir -p $IMAGE_DIR
sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR \
'arch=amd64' 'release~(trusty|xenial)' --max=1 --progress
sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR \
'os~(grub*|pxelinux)' --max=1 --progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment