Skip to content

Instantly share code, notes, and snippets.

@fujin
Created May 26, 2013 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujin/29b14d15f318918c562d to your computer and use it in GitHub Desktop.
Save fujin/29b14d15f318918c562d to your computer and use it in GitHub Desktop.
echo "This script requires superuser access to install apt packages."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
# add treasure data repository to apt
echo "deb http://packages.treasure-data.com/precise/ precise contrib" > /etc/apt/sources.list.d/treasure-data.list
# update your sources
apt-get update
# install the toolbelt
apt-get install -y --force-yes td-agent
SCRIPT
include_recipe 'ubuntu'
include_recipe 'apt'
# This should probably be configured to verify the key; you should find a key from a gnupg.net or similar.
apt_repository "treasure-data" do
uri 'http://packages.treasure-data.com/precise'
distribution node['lsb']['codename']
components %w(contrib)
end
package 'td-agent'
@fujin
Copy link
Author

fujin commented May 26, 2013

Sufficient care should be taken to add this recipe to a cookbook which contains 'depends' metadata for the 'apt' and 'ubuntu' cookbooks. Ubuntu cookbook is optional but I find it useful to have consistent chef-generated /etc/apt/sources.list across boxen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment