Permalink
Browse files

PPAs: Launchpad Personal Package Archives

Cookbook based off of the Opscode cookbook for apt.
  • Loading branch information...
0 parents commit e92c0aa5ed41019f31aa4a224e33effadf1e4746 @Sharpie committed Jan 6, 2011
Showing with 94 additions and 0 deletions.
  1. +31 −0 README.md
  2. +9 −0 metadata.rb
  3. +29 −0 providers/repository.rb
  4. +20 −0 recipes/default.rb
  5. +5 −0 resources/repository.rb
@@ -0,0 +1,31 @@
+Description
+===========
+
+Recipes
+=======
+
+Resources/Providers
+===================
+
+
+Usage
+=====
+
+
+License and Author
+==================
+
+Author:: Charlie Sharpsteen (<source@sharpsteen.net>)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
@@ -0,0 +1,9 @@
+maintainer "Charlie Sharpsteen"
+maintainer_email "source@sharpsteen.net"
+license "Apache 2.0"
+description "Manages repositories and associated GPG keys using apt-add-repository"
+version "0.0.1"
+
+%w{ ubuntu debian }.each do |os|
+ supports os
+end
@@ -0,0 +1,29 @@
+# TODO: Add support for cleanly adding normal deb repos. Right now this tool
+# is envisaged for use with repos of the form:
+# ppa:some_repository
+#
+action :add do
+ e = execute "addding ppa:#{new_resource.ppa_name}" do
+ command "apt-add-repository ppa:#{new_resource.ppa_name}"
+ action :run
+ end
+ e.run_action(:run)
+
+ e = execute "update package index" do
+ command "apt-get update"
+ action :run
+ end
+ e.run_action(:run)
+
+ new_resource.updated_by_last_action(true)
+end
+
+action :remove do
+ e = execute "removing ppa:#{new_resource.ppa_name}" do
+ command "apt-add-repository -r ppa:#{new_resource.ppa_name}"
+ action :run
+ end
+ e.run_action(:run)
+
+ new_resource.updated_by_last_action(true)
+end
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: ppa
+# Recipe:: default
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+case node[:platform]
+when "debian", "ubuntu"
+ package "python-software-properties"
+end
@@ -0,0 +1,5 @@
+actions :add, :remove
+
+# name of the ppa, as one big string.
+# TODO: Add moar customizations
+attribute :ppa_name, :kind_of => String, :name_attribute => true

0 comments on commit e92c0aa

Please sign in to comment.