This repository has been archived by the owner on Jul 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |