Skip to content

Instantly share code, notes, and snippets.

@rafaelfelini
Created November 4, 2013 00:57
Show Gist options
  • Save rafaelfelini/7296609 to your computer and use it in GitHub Desktop.
Save rafaelfelini/7296609 to your computer and use it in GitHub Desktop.
Test install nginx with chef
sudo su
cd
curl -L https://www.opscode.com/chef/install.sh | bash
chef-solo -v
cd
rm -rf *
rm -rf .chef/
mkdir .chef
echo 'cookbook_path [ "/root/chef-repo/cookbooks" ]' > .chef/knife.rb
echo 'file_cache_path "/root/chef-solo"' >> solo.rb
echo 'cookbook_path "/root/chef-repo/cookbooks"' >> solo.rb
echo '
{
"run_list": [
"recipe[nginx]"
]
}' > web.json
mkdir -p /root/chef-repo/cookbooks
cd !$
knife cookbook site download yum
knife cookbook site download apt
knife cookbook site download ohai
knife cookbook site download build-essential
knife cookbook site download runit
knife cookbook site download nginx
for file in *.gz; do tar zxf $file; done;
rm -f *.gz
cd
chef-solo -c solo.rb -j web.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment