Forked from sometimesfood/chef-standalone-bootstrap.sh
Created
October 15, 2011 16:29
-
-
Save zah/1289811 to your computer and use it in GitHub Desktop.
Chef standalone bootstrap with chef-admin-essentials
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 | |
sudo apt-get install curl git-core lsb-release | |
bash < <( curl -sL https://raw.github.com/sometimesfood/chef-admin-essentials/master/contrib/install-chef.sh ) | |
mkdir ~/cookbooks | |
cd ~/cookbooks | |
echo '*~' > .gitignore | |
git init | |
git add . | |
git commit -am 'Initial commit' | |
git submodule add git://github.com/sometimesfood/chef-admin-essentials.git admin-essentials | |
git submodule add git://github.com/sometimesfood/chef-apt-repo apt-repo | |
git commit -am 'Add chef-admin-essentials' | |
cat > config.rb <<EOF | |
cookbook_dir = File.expand_path(File.dirname(__FILE__)) | |
runlist = File.join(cookbook_dir, 'runlist.json') | |
cookbook_path cookbook_dir | |
json_attribs runlist | |
EOF | |
cat > runlist.json <<EOF | |
{ | |
"run_list": [ | |
"recipe[admin-essentials]" | |
] | |
} | |
EOF | |
git add . | |
git commit -am 'Add standalone config and runlist' | |
sudo chef-solo -c config.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment