Created
September 29, 2011 01:20
-
-
Save nbarendt/1249754 to your computer and use it in GitHub Desktop.
Brute force chef-solo install script
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 | |
set -x | |
set -e | |
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list | |
wget -qO - http://apt.opscode.com/[email protected] | sudo apt-key add - | |
# set up debconf preseed so there's no prompt for the chef server URL | |
export PRESEED_FILE=/tmp/tmp_chef_preseed | |
cat > $PRESEED_FILE <<DELIM | |
chef chef/chef_server_url string none | |
DELIM | |
sudo debconf-set-selections $PRESEED_FILE | |
rm -f $PRESEED_FILE | |
sudo apt-get -y -q update | |
sudo apt-get -y -q install chef | |
# configure /etc/chef/solo.rb using default one | |
CURRENT_DIR=`pwd` | |
sed "s|^cookbook_path.*$|cookbook_path \['$CURRENT_DIR/cookbooks'\]|g" /usr/share/chef/solo.rb > /etc/chef/solo.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment