#!/bin/bash ## # Install everything required to get chef-server up TARGET_IPADDR="15.185.181.148" SSH_KEY_FILE="/home/krogebry/.ssh/keys/KSONSoftware.pem" ## Fix that idiotic byobu garbage ssh -i ${SSH_KEY_FILE} ubuntu@${TARGET_IPADDR} 'byobu-disable' ## Fix the ssh behavior so the box is actually usable ssh -i ${SSH_KEY_FILE} ubuntu@${TARGET_IPADDR} 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/' ## Fix that idiotic byobu garbage ( this time for root ) ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'byobu-disable' ## Install some packages ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'apt-get update -y' ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'apt-get install -y libgecode-dev g++ make libyaml-dev libssl-dev' ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'apt-get install -y ruby1.9.1 rubygems1.8' ## Fixing ruby ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'update-alternatives --set ruby /usr/bin/ruby1.9.1' ## Update gems ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'gem update' ## Install chef server ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'gem install chef-server json' ## Configure chef ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'mkdir /etc/chef ; ln -s /var/lib/gems/1.8/ /var/lib/gems/1.9.1 ; mkdir /root/.chef' ## Send up some chef-solo bootstrapping bits scp -i ${SSH_KEY_FILE} files/server/solo.rb root@${TARGET_IPADDR}:/etc/chef scp -i ${SSH_KEY_FILE} files/server/chef.json root@${TARGET_IPADDR}:/root/ scp -i ${SSH_KEY_FILE} files/server/chef.init root@${TARGET_IPADDR}:/etc/init.d/chef-server scp -i ${SSH_KEY_FILE} files/server/chef-expander.init root@${TARGET_IPADDR}:/etc/init.d/chef-expander scp -i ${SSH_KEY_FILE} files/server/chef-solr.init root@${TARGET_IPADDR}:/etc/init.d/chef-solr scp -i ${SSH_KEY_FILE} files/server/knife.rb root@${TARGET_IPADDR}:/root/.chef/ ## Bootstrap chef-server ssh -i ${SSH_KEY_FILE} root@${TARGET_IPADDR} 'chef-solo -c /etc/chef/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz'
Solving complex problems with speed that creates delightful experiences in the world of cloud automation. Helping you get more out of your cloud.
Tuesday, March 27, 2012
Groovy little script to bootstrap a chef server
This is a groovy little script I wrote to bootstrap a chef-server using a HPCloud node.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment