Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

switch apt cookbook to a submodule

  • Loading branch information...
commit eacb165cf69c53bd875799ac3deea0dc1fb5d76d 1 parent 65b74dd
@vishvananda vishvananda authored
View
3  .gitmodules
@@ -4,3 +4,6 @@
[submodule "cookbooks/vagrant-openstack"]
path = cookbooks/vagrant-openstack
url = git://github.com/osops/vagrant-openstack.git
+[submodule "cookbooks/apt"]
+ path = cookbooks/apt
+ url = git://github.com/opscode-cookbooks/apt.git
1  cookbooks/apt
@@ -0,0 +1 @@
+Subproject commit 32565413858e28f465d4f6a93690baeb45aee5b0
View
122 cookbooks/apt/README.md
@@ -1,122 +0,0 @@
-Description
-===========
-
-This cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date or manage apt-cacher and cacher clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d.
-
-Recipes
-=======
-
-default
--------
-
-This recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is less than one day old.
-
-This recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.
-
-This recipe also sets up a local cache directory for preseeding packages.
-
-cacher
-------
-
-Installs the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.
-
-cacher-client
--------------
-Configures the node to use the apt-cacher server as a client.
-
-Resources/Providers
-===================
-
-This LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource.
-
-# Actions
-
-- :add: creates a repository file and builds the repository listing
-- :remove: removes the repository file
-
-# Attribute Parameters
-
-- repo_name: name attribute. The name of the channel to discover
-- uri: the base of the Debian distribution
-- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
-- components: package groupings..when it doubt use `main`
-- deb_src: whether or not to add the repository as a source repo as well
-- key_server: the GPG keyserver where the key for the repo should be retrieved
-- key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo
-
-# Examples
-
- # add the Zenoss repo
- apt_repository "zenoss" do
- uri "http://dev.zenoss.org/deb"
- components ["main","stable"]
- action :add
- end
-
- # add the Nginx PPA; grab key from keyserver
- apt_repository "nginx-php" do
- uri "http://ppa.launchpad.net/nginx/php5/ubuntu"
- distribution node['lsb']['codename']
- components ["main"]
- keyserver "keyserver.ubuntu.com"
- key "C300EE8C"
- action :add
- end
-
- # add the Cloudkick Repo
- apt_repository "cloudkick" do
- uri "http://packages.cloudkick.com/ubuntu"
- distribution node['lsb']['codename']
- components ["main"]
- key "http://packages.cloudkick.com/cloudkick.packages.key"
- action :add
- end
-
- # remove Zenoss repo
- apt_repository "zenoss" do
- action :remove
- end
-
-Usage
-=====
-
-Put `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:
-
- template "/etc/apt/sources.list.d/my_apt_sources.list" do
- notifies :run, resources(:execute => "apt-get update"), :immediately
- end
-
-The above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.
-
-Put `recipe[apt::cacher]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.
-
-Changes
-=======
-
-## v1.2.0:
-
-* COOK-136: Limit apt-get update to one run per day unless notified.
-* COOK-471: ignore failure on apt-get update
-* COOK-533: add support for deb and `deb_src` repos with `apt_repository`
-
-License and Author
-==================
-
-Author:: Joshua Timberman (<joshua@opscode.com>)
-Author:: Matt Ray (<matt@opscode.com>)
-Author:: Seth Chisamore (<schisamo@opscode.com>)
-
-Copyright 2009-2011 Opscode, Inc.
-
-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.
-
View
9 cookbooks/apt/files/default/apt-cacher
@@ -1,9 +0,0 @@
-# apt-cacher startup configuration file
-
-# IMPORTANT: check the apt-cacher.conf file before using apt-cacher as daemon.
-
-# set to 1 to start the daemon at boot time
-AUTOSTART=1
-
-# extra settings to override the ones in apt-cacher.conf
-# EXTRAOPT=" daemon_port=3142 limit=30 "
View
144 cookbooks/apt/files/default/apt-cacher.conf
@@ -1,144 +0,0 @@
-# This file has been modified by ./apt-proxy-to-apt-cacher
-# Some lines may have been appended at the bottom of this file
-# This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
-# Some lines may have been appended at the bottom of this file
-#################################################################
-# This is the config file for apt-cacher. On most Debian systems
-# you can safely leave the defaults alone.
-#################################################################
-
-# cache_dir is used to set the location of the local cache. This can
-# become quite large, so make sure it is somewhere with plenty of space.
-cache_dir=/var/cache/apt-cacher
-
-# The email address of the administrator is displayed in the info page
-# and traffic reports.
-admin_email=root@localhost
-
-# For the daemon startup settings please edit the file /etc/default/apt-cacher.
-
-# Daemon port setting, only useful in stand-alone mode. You need to run the
-# daemon as root to use privileged ports (<1024).
-daemon_port = 3142
-
-# optional settings, user and group to run the daemon as. Make sure they have
-# sufficient permissions on the cache and log directories. Comment the settings
-# to run apt-cacher as the native user.
-group=www-data
-user=www-data
-
-# optional setting, binds the listening daemon to one specified IP. Use IP
-# ranges for more advanced configuration, see below.
-# daemon_addr=localhost
-
-# If your apt-cacher machine is directly exposed to the Internet and you are
-# worried about unauthorised machines fetching packages through it, you can
-# specify a list of IPv4 addresses which are allowed to use it and another
-# list of IPv4 addresses which aren't.
-# Localhost (127.0.0.1) is always allowed. Other addresses must be matched
-# by allowed_hosts and not by denied_hosts to be permitted to use the cache.
-# Setting allowed_hosts to "*" means "allow all".
-# Otherwise the format is a comma-separated list containing addresses,
-# optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
-# addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
-allowed_hosts=*
-denied_hosts=
-
-# And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
-# Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
-# w.x.y.z and are handled as IPv4.
-allowed_hosts_6=fec0::/16
-denied_hosts_6=
-
-# This thing can be done by Apache but is much simplier here - limit access to
-# Debian mirrors based on server names in the URLs
-#allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
-
-# Apt-cacher can generate usage reports every 24 hours if you set this
-# directive to 1. You can view the reports in a web browser by pointing
-# to your cache machine with '/apt-cacher/report' on the end, like this:
-# http://yourcache.example.com/apt-cacher/report
-# Generating reports is very fast even with many thousands of logfile
-# lines, so you can safely turn this on without creating much
-# additional system load.
-generate_reports=1
-
-# Apt-cacher can clean up its cache directory every 24 hours if you set
-# this directive to 1. Cleaning the cache can take some time to run
-# (generally in the order of a few minutes) and removes all package
-# files that are not mentioned in any existing 'Packages' lists. This
-# has the effect of deleting packages that have been superseded by an
-# updated 'Packages' list.
-clean_cache=1
-
-# The directory to use for apt-cacher access and error logs.
-# The access log records every request in the format:
-# date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
-# The error log is slightly more free-form, and is also used for debug
-# messages if debug mode is turned on.
-# Note that the old 'logfile' and 'errorfile' directives are
-# deprecated: if you set them explicitly they will be honoured, but it's
-# better to just get rid of them from old config files.
-logdir=/var/log/apt-cacher
-
-# apt-cacher can use different methods to decide whether package lists need to
-# be updated,
-# A) looking at the age of the cached files
-# B) getting HTTP header from server and comparing that with cached data. This
-# method is more reliable and avoids desynchronisation of data and index files
-# but needs to transfer few bytes from the server every time somebody requests
-# the files ("apt-get update")
-# Set the following value to the maximum age (in hours) for method A or to 0
-# for method B
-expire_hours=0
-
-# Apt-cacher can pass all its requests to an external http proxy like
-# Squid, which could be very useful if you are using an ISP that blocks
-# port 80 and requires all web traffic to go through its proxy. The
-# format is 'hostname:port', eg: 'proxy.example.com:8080'.
-http_proxy=proxy.example.com:8080
-
-# Use of an external proxy can be turned on or off with this flag.
-# Value should be either 0 (off) or 1 (on).
-use_proxy=0
-
-# External http proxy sometimes need authentication to get full access. The
-# format is 'username:password'.
-http_proxy_auth=proxyuser:proxypass
-
-# Use of external proxy authentication can be turned on or off with this flag.
-# Value should be either 0 (off) or 1 (on).
-use_proxy_auth=0
-
-# Rate limiting sets the maximum bandwidth in bytes per second to use
-# for fetching packages. Syntax is fully defined in 'man wget'.
-# Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
-# Use 0 or a negative value for no rate limiting.
-limit=0
-
-# Debug mode makes apt-cacher spew a lot of extra debug junk to the
-# error log (whose location is defined with the 'logdir' directive).
-# Leave this off unless you need it, or your error log will get very
-# big. Acceptable values are 0 or 1.
-debug=0
-
-# Adapt the line in the usage info web page to match your server configuration
-# example_sources_line=deb&nbsp;http://<b>my.cacher.server:3142/</b>ftp.au.debian.org/debian&nbsp;unstable&nbsp;main&nbsp;contrib&nbsp;non-free
-
-# Print a 410 (Gone) HTTP message with the specified text when accessed via
-# CGI. Useful to tell users to adapt their sources.list files when the
-# apt-cacher server is beeing relocated (via apt-get's error messages while
-# running "update")
-#cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
-#cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
-
-# Server mapping - this allows to hide real server names behind virtual paths
-# that appear in the access URL. This method is known from apt-proxy. This is
-# also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
-# path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
-# Note that you need to specify all target servers in the allowed_locations
-# options if you make use of it. Also note that the paths should not overlap
-# each other. FTP access method not supported yet, maybe in the future.
-
-# extra setting from apt-proxy configuration
-path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
View
50 cookbooks/apt/files/default/apt-proxy-v2.conf
@@ -1,50 +0,0 @@
-[DEFAULT]
-;; All times are in seconds, but you can add a suffix
-;; for minutes(m), hours(h) or days(d)
-
-;; commented out address so apt-proxy will listen on all IPs
-;; address = 127.0.0.1
-port = 9999
-cache_dir = /var/cache/apt-proxy
-
-;; Control files (Packages/Sources/Contents) refresh rate
-min_refresh_delay = 1s
-complete_clientless_downloads = 1
-
-;; Debugging settings.
-debug = all:4 db:0
-
-time = 30
-passive_ftp = on
-
-;;--------------------------------------------------------------
-;; Cache housekeeping
-
-cleanup_freq = 1d
-max_age = 120d
-max_versions = 3
-
-;;---------------------------------------------------------------
-;; Backend servers
-;;
-;; Place each server in its own [section]
-
-[ubuntu]
-; Ubuntu archive
-backends =
- http://us.archive.ubuntu.com/ubuntu
-
-[ubuntu-security]
-; Ubuntu security updates
-backends = http://security.ubuntu.com/ubuntu
-
-[debian]
-;; Backend servers, in order of preference
-backends =
- http://debian.osuosl.org/debian/
-
-[security]
-;; Debian security archive
-backends =
- http://security.debian.org/debian-security
- http://ftp2.de.debian.org/debian-security
View
34 cookbooks/apt/metadata.json
@@ -1,34 +0,0 @@
-{
- "name": "apt",
- "description": "Configures apt and apt services and an LWRP for managing apt repositories",
- "long_description": "Description\n===========\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date or manage apt-cacher and cacher clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d.\n\nRecipes\n=======\n\ndefault\n-------\n\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is less than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\ncacher\n------\n\nInstalls the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.\n\ncacher-client\n-------------\nConfigures the node to use the apt-cacher server as a client.\n\nResources/Providers\n===================\n\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource.\n\n# Actions\n\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n# Attribute Parameters\n\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings..when it doubt use `main`\n- deb_src: whether or not to add the repository as a source repo as well\n- key_server: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo\n\n# Examples\n\n # add the Zenoss repo\n apt_repository \"zenoss\" do\n uri \"http://dev.zenoss.org/deb\"\n components [\"main\",\"stable\"]\n action :add\n end\n \n # add the Nginx PPA; grab key from keyserver\n apt_repository \"nginx-php\" do\n uri \"http://ppa.launchpad.net/nginx/php5/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n keyserver \"keyserver.ubuntu.com\"\n key \"C300EE8C\"\n action :add\n end\n \n # add the Cloudkick Repo\n apt_repository \"cloudkick\" do\n uri \"http://packages.cloudkick.com/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n key \"http://packages.cloudkick.com/cloudkick.packages.key\"\n action :add\n end\n \n # remove Zenoss repo\n apt_repository \"zenoss\" do\n action :remove\n end\n \nUsage\n=====\n\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n template \"/etc/apt/sources.list.d/my_apt_sources.list\" do\n notifies :run, resources(:execute => \"apt-get update\"), :immediately\n end\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nChanges\n=======\n\n## v1.2.0:\n\n* COOK-136: Limit apt-get update to one run per day unless notified.\n* COOK-471: ignore failure on apt-get update\n* COOK-533: add support for deb and `deb_src` repos with `apt_repository`\n\nLicense and Author\n==================\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\nAuthor:: Matt Ray (<matt@opscode.com>)\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\n\nCopyright 2009-2011 Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n",
- "maintainer": "Opscode, Inc.",
- "maintainer_email": "cookbooks@opscode.com",
- "license": "Apache 2.0",
- "platforms": {
- "ubuntu": ">= 0.0.0",
- "debian": ">= 0.0.0"
- },
- "dependencies": {
- },
- "recommendations": {
- },
- "suggestions": {
- },
- "conflicting": {
- },
- "providing": {
- },
- "replacing": {
- },
- "attributes": {
- },
- "groupings": {
- },
- "recipes": {
- "apt": "Runs apt-get update during compile phase and sets up preseed directories",
- "apt::cacher": "Set up an APT cache",
- "apt::cacher-client": "Client for the apt::cacher server"
- },
- "version": "1.2.0"
-}
View
13 cookbooks/apt/metadata.rb
@@ -1,13 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Configures apt and apt services and an LWRP for managing apt repositories"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.2.0"
-recipe "apt", "Runs apt-get update during compile phase and sets up preseed directories"
-recipe "apt::cacher", "Set up an APT cache"
-recipe "apt::cacher-client", "Client for the apt::cacher server"
-
-%w{ ubuntu debian }.each do |os|
- supports os
-end
View
73 cookbooks/apt/providers/repository.rb
@@ -1,73 +0,0 @@
-#
-# Cookbook Name:: apt
-# Provider:: repository
-#
-# Copyright 2010-2011, Opscode, Inc.
-#
-# 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.
-#
-
-action :add do
- unless ::File.exists?("/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list")
- Chef::Log.info "Adding #{new_resource.repo_name} repository to /etc/apt/sources.list.d/#{new_resource.repo_name}-source.list"
- # add key
- if new_resource.keyserver && new_resource.key
- execute "install-key #{new_resource.key}" do
- command "apt-key adv --keyserver #{new_resource.keyserver} --recv #{new_resource.key}"
- action :nothing
- end.run_action(:run)
- elsif new_resource.key && (new_resource.key =~ /http/)
- key_name = new_resource.key.split(/\//).last
- remote_file "#{Chef::Config[:file_cache_path]}/#{key_name}" do
- source new_resource.key
- mode "0644"
- action :nothing
- end.run_action(:create_if_missing)
- execute "install-key #{key_name}" do
- command "apt-key add #{Chef::Config[:file_cache_path]}/#{key_name}"
- action :nothing
- end.run_action(:run)
- end
- # build our listing
- repository = "deb"
- repository = "deb-src" if new_resource.deb_src
- repository = "# Created by the Chef apt_repository LWRP\n" + repository
- repository += " #{new_resource.uri}"
- repository += " #{new_resource.distribution}"
- new_resource.components.each {|component| repository += " #{component}"}
- # write out the file, replace it if it already exists
- file "/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list" do
- owner "root"
- group "root"
- mode 0644
- content repository + "\n"
- action :nothing
- end.run_action(:create)
- execute "update package index" do
- command "apt-get update"
- ignore_failure true
- action :nothing
- end.run_action(:run)
- new_resource.updated_by_last_action(true)
- end
-end
-
-action :remove do
- if ::File.exists?("/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list")
- Chef::Log.info "Removing #{new_resource.repo_name} repository from /etc/apt/sources.list.d/"
- file "/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list" do
- action :delete
- end
- new_resource.updated_by_last_action(true)
- end
-end
View
44 cookbooks/apt/recipes/cacher-client.rb
@@ -1,44 +0,0 @@
-#
-# Cookbook Name:: apt
-# Recipe:: cacher-client
-#
-# Copyright 2011, Opscode, Inc.
-#
-# 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.
-#
-
-#remove Acquire::http::Proxy lines from /etc/apt/apt.conf since we use 01proxy
-#these are leftover from preseed installs
-execute "Remove proxy from /etc/apt/apt.conf" do
- command "sed --in-place '/^Acquire::http::Proxy/d' /etc/apt/apt.conf"
- only_if "grep Acquire::http::Proxy /etc/apt/apt.conf"
-end
-
-servers = search(:node, 'recipes:apt\:\:cacher') || []
-if servers.length > 0
- Chef::Log.info("apt-cacher server found on #{servers[0]}.")
- proxy = "Acquire::http::Proxy \"http://#{servers[0].ipaddress}:3142\";\n"
- file "/etc/apt/apt.conf.d/01proxy" do
- owner "root"
- group "root"
- mode "0644"
- content proxy
- action :create
- end
-else
- Chef::Log.info("No apt-cacher server found.")
- file "/etc/apt/apt.conf.d/01proxy" do
- action :delete
- only_if {File.exists?("/etc/apt/apt.conf.d/01proxy")}
- end
-end
View
45 cookbooks/apt/recipes/cacher.rb
@@ -1,45 +0,0 @@
-#
-# Cookbook Name:: apt
-# Recipe:: cacher
-#
-# Copyright 2008-2011, Opscode, Inc.
-#
-# 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.
-#
-package "apt-cacher" do
- action :install
-end
-
-service "apt-cacher" do
- supports :restart => true, :status => false
- action [ :enable, :start ]
-end
-
-cookbook_file "/etc/apt-cacher/apt-cacher.conf" do
- source "apt-cacher.conf"
- owner "root"
- group "root"
- mode 0644
- notifies :restart, resources(:service => "apt-cacher")
-end
-
-cookbook_file "/etc/default/apt-cacher" do
- source "apt-cacher"
- owner "root"
- group "root"
- mode 0644
- notifies :restart, resources(:service => "apt-cacher")
-end
-
-#this will help seed the proxy
-include_recipe "apt::cacher-client"
View
50 cookbooks/apt/recipes/default.rb
@@ -1,50 +0,0 @@
-#
-# Cookbook Name:: apt
-# Recipe:: default
-#
-# Copyright 2008-2011, Opscode, Inc.
-# Copyright 2009, Bryan McLellan <btm@loftninjas.org>
-#
-# 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.
-#
-
-# Run apt-get update to create the stamp file
-execute "apt-get-update" do
- command "apt-get update"
- ignore_failure true
- not_if do ::File.exists?('/var/lib/apt/periodic/update-success-stamp') end
- action :nothing
-end
-
-# provides /var/lib/apt/periodic/update-success-stamp on apt-get update
-package "update-notifier-common" do
- notifies :run, resources(:execute => "apt-get-update"), :immediately
-end
-
-execute "apt-get-update-periodic" do
- command "apt-get update"
- ignore_failure true
- only_if do
- File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
- File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400
- end
-end
-
-%w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
- directory dirname do
- owner "root"
- group "root"
- mode 0644
- action :create
- end
-end
View
30 cookbooks/apt/resources/repository.rb
@@ -1,30 +0,0 @@
-#
-# Cookbook Name:: apt
-# Resource:: repository
-#
-# Copyright 2010-2011, Opscode, Inc.
-#
-# 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.
-#
-
-actions :add, :remove
-
-#name of the repo, used for source.list filename
-attribute :repo_name, :kind_of => String, :name_attribute => true
-attribute :uri, :kind_of => String
-attribute :distribution, :kind_of => String
-attribute :components, :kind_of => Array, :default => []
-#whether or not to add the repository as a source repo as well
-attribute :deb_src, :default => false
-attribute :keyserver, :kind_of => String, :default => nil
-attribute :key, :kind_of => String, :default => nil
Please sign in to comment.
Something went wrong with that request. Please try again.