Created
April 30, 2010 20:36
-
-
Save hosh/385718 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
# Configuration | |
#CLOUD_ETH="eth0" | |
CLOUD_ETH="eth1" # Standard for Rackspace Cloud | |
CHEFSERVER="10.177.133.40" | |
# Do not edit below | |
NODE=`dd if=/dev/urandom count=1 2> /dev/null | md5sum | head -n 2 | tail -n 1 | cut -c-26` | |
NODE_NAME="node-${NODE}" | |
IP=`ifconfig ${CLOUD_ETH} | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` | |
echo "BOOTSTRAP: I am ${NODE_NAME}" | |
echo "HOSTNAME=\"${NODE_NAME}\"" > /etc/conf.d/hostname | |
echo "" >> /etc/hosts | |
echo "${IP} ${NODE_NAME}" >> /etc/hosts | |
echo "${CHEFSERVER} bork chef-server" >> /etc/hosts | |
/etc/init.d/hostname restart | |
echo `hostname -f` | |
cat /etc/hosts | |
rm -f /etc/chef/client.pem | |
chef-client -V | |
/etc/init.d/chef-client start | |
rc-update add chef-client default | |
rm -f /etc/conf.d/bootstrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment