From aef49e22e7c43f5b939ab3eda55a5bbc8dd8e16a Mon Sep 17 00:00:00 2001 From: epwn Date: Thu, 7 Jan 2016 15:01:55 -0600 Subject: [PATCH] Add prepare baremetal steps Adds steps to prepare baremetals before running site.yml Note: cleaned up some code --- depl/pre/bootstrap-deployer | 8 ++++---- depl/pre/prepare_baremetals | 6 ++++++ vm/rebuild/rebuild.sh | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100755 depl/pre/prepare_baremetals diff --git a/depl/pre/bootstrap-deployer b/depl/pre/bootstrap-deployer index f3e2241..a891afb 100755 --- a/depl/pre/bootstrap-deployer +++ b/depl/pre/bootstrap-deployer @@ -2,9 +2,9 @@ # check for service name and git repo supplied on CLI if [ "$#" -ne 2 ]; then - echo -e "Not enough args given. Please use the form:\n./bootstrap-deployer " - echo -e "Example:\n./bootstrap-deployer CullenTaylor https://github.com/USER/REPO" - exit + echo -e "Not enough args given. Please use the form:\n./bootstrap-deployer " + echo -e "Example:\n./bootstrap-deployer CullenTaylor https://github.com/USER/REPO" + exit fi # install prerequisite packages @@ -16,7 +16,7 @@ echo -e "export WORKON_HOME=$HOME/.virtualenvs\nexport PROJECT_HOME=/root/develo source ~/.bashrc if [ ! -d "/root/deployment" ]; then - mkdir /root/deployment + mkdir /root/deployment fi cd /root/deployment diff --git a/depl/pre/prepare_baremetals b/depl/pre/prepare_baremetals new file mode 100755 index 0000000..860f232 --- /dev/null +++ b/depl/pre/prepare_baremetals @@ -0,0 +1,6 @@ +#!!/usr/bin/env bash + +#prepare baremetals for ursula deploy +for i in $(cat ~/.ssh/config | grep Host | grep HostName | awk '{ print $2 }'); do + ssh $i 'echo \"APT::Get::AllowUnauthenticated \"true\";\" >> /etc/apt/apt.conf.d/99myauth; apt-get update; parted /dev/sdb --script rm 1' +done diff --git a/vm/rebuild/rebuild.sh b/vm/rebuild/rebuild.sh index 19b9716..2a0615e 100644 --- a/vm/rebuild/rebuild.sh +++ b/vm/rebuild/rebuild.sh @@ -37,7 +37,7 @@ do fi done -# the biz +# Allow for unauthenticated packages for arg in "$@" do if [[ "$arg" != "-p" ]]; then