Skip to content

Instantly share code, notes, and snippets.

@day0hero
Last active June 11, 2022 11:32
Show Gist options
  • Save day0hero/8be0013040d773fcf03173c9888e9ebc to your computer and use it in GitHub Desktop.
Save day0hero/8be0013040d773fcf03173c9888e9ebc to your computer and use it in GitHub Desktop.
Example Makefile
IPADDR=$(shell ip a | grep -Eo 'inet ([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | awk '{print $$2}')
deploy: prereqs
echo "Let's get this party started"
make bootstrap
images: prereqs
echo "Unpacking images onto machine"
"sudo tar xvf sparta-utility.tar.gz -C /root/utility"
"sudo mv ocp-images.tar /root/utility"
echo "Creating ssh keys"
"bash /root/utility/sparta2/ssh-keys.sh"
echo "image load up"
"sudo podman load -i /root/utility/tar-bundles/utility.tar"
prereqs:
echo "Configuring prerequisites"
sudo dnf install -y podman
sudo mkdir -p /root/utility
bootstrap:
sed -i 's/IPADDR/$(IPADDR)/' /tmp/inventory
grep -A2 remote /tmp/inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment