Skip to content

Instantly share code, notes, and snippets.

@rafaelfelini
Created November 4, 2013 00:57
Show Gist options
  • Save rafaelfelini/7296604 to your computer and use it in GitHub Desktop.
Save rafaelfelini/7296604 to your computer and use it in GitHub Desktop.
Test install java 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[java]"
],
"java": {
"install_flavor": "oracle",
"jdk_version": "6",
"oracle" : {
"accept_oracle_download_terms": "true"
}
}
}' > web.json
mkdir -p /root/chef-repo/cookbooks
cd !$
knife cookbook site download java
knife cookbook site download windows
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