Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Created November 16, 2010 21:39
Show Gist options
  • Select an option

  • Save jtimberman/702564 to your computer and use it in GitHub Desktop.

Select an option

Save jtimberman/702564 to your computer and use it in GitHub Desktop.
file "/etc/apt/sources.list.d/my-ppa.list" do
content "deb http://ppa.launchpad.net/USER/ppa/ubuntu lucid main"
owner "root"
group "root"
mode 0644
end
execute "Add PPA key" do
command "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY"
not_if "apt-key list | grep -xq '.*1024R/KEY.*'"
end
execute "apt-get update" do
action :nothing
subscribes :run, resources(:execute => "Add PPA key"), :immediately
subscribes :run, resources(:file => "/etc/apt/sources.list.d/my-ppa.list"), :immediately
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment