#!/bin/bash # This script expects the following to be installed: # curl, libguestfs-tools-c IMAGE_URL=http://archive.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64 IMAGE=Fedora-Cloud-Base-20141203-21.x86_64.qcow2 TARGET_DIR=/var/lib/libvirt/images TARGET=fedora-21-x86_64 export LIBGUESTFS_BACKEND=direct if ! [ -f "$IMAGE" ]; then echo "Downloading $IMAGE" curl -L -O $IMAGE_URL/$IMAGE fi echo "Copying $IMAGE to $TARGET" cp "$IMAGE" $TARGET_DIR/$TARGET TMPFILE=$(mktemp /tmp/kolla-ifcfg-eth1.XXXXXXXXXX) cat > $TMPFILE <