Last active
April 11, 2017 05:46
-
-
Save jackprice/89df795db65d6748834e518b7504dc24 to your computer and use it in GitHub Desktop.
Ansible+Kickstarter Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
VOLUME_LABEL="OEMDRV" | |
if [ $# -ne 2 ]; then | |
echo "Invalid invocation" | |
echo "Usage:" | |
echo | |
echo " $0 SOURCE OUTPUT" | |
echo | |
echo " SOURCE should be a built Kickstart configuration file" | |
echo " OUTPUT should be the location to store the built ISO" | |
echo | |
exit 1 | |
fi | |
SOURCE="$1" | |
DEST="$2" | |
if [ ! -f "$SOURCE" ]; then | |
echo "Source file does not exist" | |
exit 1 | |
fi | |
TEMP=$(mktemp -d) | |
cp "$SOURCE" "${TEMP}/ks.cfg" | |
mkisofs -V "$VOLUME_LABEL" -o "$DEST" "$TEMP" | |
rm -r "$TEMP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build/%.iso: build/%.cfg | |
./build-configuration-iso.sh build/$*.cfg build/$*.iso | |
build/%.cfg: kickstart.cfg.j2 | |
ansible-playbook --limit $* template-kickstart.yml | |
.PHONY: clean | |
clean: | |
rm -rf build/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment