Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Last active December 22, 2015 15:08
Show Gist options
  • Save jeffmccune/6490141 to your computer and use it in GitHub Desktop.
Save jeffmccune/6490141 to your computer and use it in GitHub Desktop.
#! /bin/bash
#
# curl --cacert /etc/ssl/certs/ca-bundle.crt -Lo- https://goo.gl/2ASdos | bash
#
# Cloud Instance Setup script
# Assumes CentOS 6 instance
set -e
set -u
set -x
cd ~
if ! [ -d .ssh ]; then
mkdir .ssh
chmod 700 .ssh
fi
key='git.puppetlabs.net,74.85.255.21 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrWPu2+CNgDUe2leLYNpae0g7+XgbVUPm5rSrEM2cycllO3DA4FnEHjIEI/XNYzxXtEsONgpTCLLiPp1pfHgy93diGRD2JIKnCUfXHNOvH/Vq3TMqjw/WSO7B2E/Y+II4EyvcFMEVQZwj5vCdBMQlkBkqy1UIUpH+Dpp4/PxBOsxJKOV1b2vI7RIlDLBqiPvW+yMkG3RWpMXLxfmnJ0f7lS44uiXxaIE39gJ2MEaIdHCswz3qSCV47Oz13ltfFZ4nk5T4cL//Twqdfdshy8+loe78rZ8XEkBM1/sGkJO38RavmLlXrGJau5/c3upaUXQVLRW4NiWXo+ZSRCFSljpYD'
grep -qx "$key" .ssh/known_hosts || echo "$key" >> .ssh/known_hosts
chmod 644 .ssh/known_hosts
# sudo backline puppet agent -t --server puppetmaster.service || rval=$?
: ${rval:=0}
if ! [ ${rval} -eq 0 -o $rval -eq 2 ]; then
echo "Exiting because of a Puppet failure (rval=$rval)"
exit 1
fi
sudo yum -y upgrade
rpm -q backline-release || sudo yum -y install http://packages.service.backline.puppetlabs.net/yum/backline/latest/el/6/backline-release.rpm
sudo yum -y install screen git ruby zsh backline vim
if ! [ -d customization ]; then
git clone [email protected]:[email protected]/customization.git
cd customization
git submodule init
git submodule update
cd ~
./customization/install
fi
[ -d .vim ] || git clone https://github.com/jeffmccune/jeff_vim .vim
[ -d .vimswp ] || mkdir .vimswp
[ -e .vimrc ] || ln -s .vim/vimrc.vim .vimrc
# [ -d backline ] || git clone [email protected]:[email protected]/backline.git
# sudo chsh -s /bin/zsh ${USERNAME:-jeff}
set +x
echo "Reboot now with shutdown -r now"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment