Last active
August 29, 2015 14:01
-
-
Save kelsin/8592dd9714d054d1074f to your computer and use it in GitHub Desktop.
Installing a new server with Chef
This file contains 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
# Setup my home directory git | |
# Make sure you're ssh'd to the server with agent forwarding | |
cd | |
git init . | |
git remote add origin git@github.com:Kelsin/configs.git | |
git fetch origin | |
rm .bashrc | |
rm .bash_logout | |
git checkout master |
This file contains 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
# Ssh to the new server as root | |
# Update and Upgrade | |
aptitude update | |
aptitude dist-upgrade | |
# First we install needed packages to build things | |
aptitude install git build-essential libssl-dev | |
# Install rbenv and ruby-build | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
. .bash_profile | |
# Install ruby and chef (takes awhile) | |
rbenv install 2.1.2 | |
rbenv global 2.1.2 | |
gem install chef librarian-chef ruby-shadow | |
rbenv rehash | |
# Install Chef repo and run! | |
git clone git@github.com:Kelsin/chef.git | |
cd chef | |
librarian-chef install | |
chef-solo -c solo.rb -j solo.json | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment