-
-
Save 0xGGGGG/4419194 to your computer and use it in GitHub Desktop.
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
#!/bin/bash -xe | |
#THIS SCRIPT MUST BE RUN AS ROOT | |
#configure SSH | |
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuwaDITgrsmxVvSJ+HEir4iW2eBb8XqB3wIxCWJwmhiB2S6MkdX1CFcj8boHL2RIYgKN0yiTCVlOdQFjhyRpnd8NbS0RW7753SE1hzkgOg+2e1B15lf1PCSD5OPWAtpb1eYlLcs6hns+yFhYCFeQrKLBL2/si8D8OcQcTR7BjjFQEWdhjl4cYiT68cr57yFT+c/f32ZTynEWukC2YIGMjJ1nACUOYF8CSp6RUrD2kY3C1Pb1Q5V3jwi0lhay4aF5AWp28hPVtYASBe2BrYXp8uErhnmWxgXNV19P0NSHE7TBXd9nXz/njI2SDP/p2N/vHquz/Ybxs4F+kGGXknUFitQ== [email protected]" | |
echo $SSH_KEY >> /home/ubuntu/.ssh/authorized_keys | |
#configure locale | |
echo "export LANGUAGE=en_AU.UTF-8" > /tmp/locale | |
echo "export LANG=en_AU.UTF-8" >> /tmp/locale | |
echo "export LC_ALL=en_AU.UTF-8" >> /tmp/locale | |
cat /etc/bash.bashrc >> /tmp/locale | |
cp /tmp/locale /etc/bash.bashrc | |
locale-gen en_AU.UTF-8 | |
dpkg-reconfigure locales | |
#update packages | |
echo "deb http://apt.opscode.com/ precise-0.10 main" | tee /etc/apt/sources.list.d/opscode.list | |
mkdir -p /etc/apt/trusted.gpg.d | |
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A | |
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null | |
apt-get update | |
apt-get install opscode-keyring -y | |
apt-get upgrade -y | |
#synchronise time | |
ntpdate ntp.ubuntu.com | |
#install ruby | |
RUBY_PATCH=p327 | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-$RUBY_PATCH.tar.gz | |
tar -xvzf ruby-1.9.3-$RUBY_PATCH.tar.gz | |
cd ruby-1.9.3-$RUBY_PATCH/ | |
./configure --prefix=/usr/local | |
make | |
make install | |
#install chef | |
apt-get install chef chef-server -y | |
mkdir -p /home/ubuntu/.chef | |
cp /etc/chef/validation.pem /etc/chef/webui.pem /home/ubuntu/.chef | |
chown -R ubuntu /home/ubuntu/.chef | |
apt-get install git-core -y | |
#exit root console and | |
#knife configure -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment