vagabond 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/Vagrantfile +34 -0
- data/lib/vagabond/cookbooks/apt/Berksfile +8 -0
- data/lib/vagabond/cookbooks/apt/CHANGELOG.md +97 -0
- data/lib/vagabond/cookbooks/apt/CONTRIBUTING +29 -0
- data/lib/vagabond/cookbooks/apt/LICENSE +201 -0
- data/lib/vagabond/cookbooks/apt/README.md +243 -0
- data/lib/vagabond/cookbooks/apt/TESTING.md +25 -0
- data/lib/vagabond/cookbooks/apt/attributes/default.rb +4 -0
- data/lib/vagabond/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/lib/vagabond/cookbooks/apt/metadata.rb +30 -0
- data/lib/vagabond/cookbooks/apt/providers/preference.rb +61 -0
- data/lib/vagabond/cookbooks/apt/providers/repository.rb +132 -0
- data/lib/vagabond/cookbooks/apt/recipes/cacher-client.rb +59 -0
- data/lib/vagabond/cookbooks/apt/recipes/cacher-ng.rb +40 -0
- data/lib/vagabond/cookbooks/apt/recipes/default.rb +68 -0
- data/lib/vagabond/cookbooks/apt/resources/preference.rb +30 -0
- data/lib/vagabond/cookbooks/apt/resources/repository.rb +40 -0
- data/lib/vagabond/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
- data/lib/vagabond/cookbooks/apt/templates/default/01proxy.erb +2 -0
- data/lib/vagabond/cookbooks/apt/templates/default/acng.conf.erb +276 -0
- data/lib/vagabond/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/README.md +1 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/cacher-ng_test.rb +28 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/default_test.rb +28 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/lwrps_test.rb +48 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/support/helpers.rb +29 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/metadata.rb +6 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/cacher-ng.rb +20 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/default.rb +20 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/lwrps.rb +66 -0
- data/lib/vagabond/cookbooks/vagabond/metadata.rb +1 -0
- data/lib/vagabond/cookbooks/vagabond/recipes/default.rb +9 -0
- data/lib/vagabond/vagabond.rb +5 -1
- data/lib/vagabond/version.rb +1 -1
- data/test/Vagrantfile +48 -0
- data/vagabond-0.2.6.gem +0 -0
- data/vagabond.gemspec +1 -1
- metadata +36 -4
@@ -0,0 +1,270 @@
|
|
1
|
+
|
2
|
+
# Letter case in directive names does not matter. Must be separated with colons.
|
3
|
+
# Valid boolean values are a zero number for false, non-zero numbers for true.
|
4
|
+
|
5
|
+
CacheDir: /var/cache/apt-cacher-ng
|
6
|
+
|
7
|
+
# set empty to disable logging
|
8
|
+
LogDir: /var/log/apt-cacher-ng
|
9
|
+
|
10
|
+
# place to look for additional configuration and resource files if they are not
|
11
|
+
# found in the configuration directory
|
12
|
+
# SupportDir: /usr/lib/apt-cacher-ng
|
13
|
+
|
14
|
+
# TCP (http) port
|
15
|
+
# Set to 9999 to emulate apt-proxy
|
16
|
+
Port:<%= node['apt']['cacher_port'] %>
|
17
|
+
|
18
|
+
# Addresses or hostnames to listen on. Multiple addresses must be separated by
|
19
|
+
# spaces. Each entry must be an exact local address which is associated with a
|
20
|
+
# local interface. DNS resolution is performed using getaddrinfo(3) for all
|
21
|
+
# available protocols (IPv4, IPv6, ...). Using a protocol specific format will
|
22
|
+
# create binding(s) only on protocol specific socket(s) (e.g. 0.0.0.0 will listen
|
23
|
+
# only to IPv4).
|
24
|
+
#
|
25
|
+
# Default: not set, will listen on all interfaces and protocols
|
26
|
+
#
|
27
|
+
# BindAddress: localhost 192.168.7.254 publicNameOnMainInterface
|
28
|
+
|
29
|
+
# The specification of another proxy which shall be used for downloads.
|
30
|
+
# Username and password are, and see manual for limitations.
|
31
|
+
#
|
32
|
+
#Proxy: http://www-proxy.example.net:80
|
33
|
+
#proxy: username:proxypassword@proxy.example.net:3128
|
34
|
+
|
35
|
+
# Repository remapping. See manual for details.
|
36
|
+
# In this example, some backends files might be generated during package
|
37
|
+
# installation using information collected on the system.
|
38
|
+
Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
|
39
|
+
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
|
40
|
+
Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives
|
41
|
+
|
42
|
+
# This is usually not needed for security.debian.org because it's always the
|
43
|
+
# same DNS hostname. However, it might be enabled in order to use hooks,
|
44
|
+
# ForceManaged mode or special flags in this context.
|
45
|
+
# Remap-secdeb: security.debian.org
|
46
|
+
|
47
|
+
# Virtual page accessible in a web browser to see statistics and status
|
48
|
+
# information, i.e. under http://localhost:3142/acng-report.html
|
49
|
+
ReportPage: acng-report.html
|
50
|
+
|
51
|
+
# Socket file for accessing through local UNIX socket instead of TCP/IP. Can be
|
52
|
+
# used with inetd bridge or cron client.
|
53
|
+
# SocketPath:/var/run/apt-cacher-ng/socket
|
54
|
+
|
55
|
+
# Forces log file to be written to disk after every line when set to 1. Default
|
56
|
+
# is 0, buffers are flushed when the client disconnects.
|
57
|
+
#
|
58
|
+
# (technically, alias to the Debug option, see its documentation for details)
|
59
|
+
#
|
60
|
+
# UnbufferLogs: 0
|
61
|
+
|
62
|
+
# Set to 0 to store only type, time and transfer sizes.
|
63
|
+
# 1 -> client IP and relative local path are logged too
|
64
|
+
# VerboseLog: 1
|
65
|
+
|
66
|
+
# Don't detach from the console
|
67
|
+
# ForeGround: 0
|
68
|
+
|
69
|
+
# Store the pid of the daemon process therein
|
70
|
+
# PidFile: /var/run/apt-cacher-ng/pid
|
71
|
+
|
72
|
+
# Forbid outgoing connections, work around them or respond with 503 error
|
73
|
+
# offlinemode:0
|
74
|
+
|
75
|
+
# Forbid all downloads that don't run through preconfigured backends (.where)
|
76
|
+
#ForceManaged: 0
|
77
|
+
|
78
|
+
# Days before considering an unreferenced file expired (to be deleted).
|
79
|
+
# Warning: if the value is set too low and particular index files are not
|
80
|
+
# available for some days (mirror downtime) there is a risk of deletion of
|
81
|
+
# still useful package files.
|
82
|
+
ExTreshold: 4
|
83
|
+
|
84
|
+
# Stop expiration when a critical problem appeared. Currently only failed
|
85
|
+
# refresh of an index file is considered as critical.
|
86
|
+
#
|
87
|
+
# WARNING: don't touch this option or set to zero.
|
88
|
+
# Anything else is DANGEROUS and may cause data loss.
|
89
|
+
#
|
90
|
+
# ExAbortOnProblems: 1
|
91
|
+
|
92
|
+
# Replace some Windows/DOS-FS incompatible chars when storing
|
93
|
+
# StupidFs: 0
|
94
|
+
|
95
|
+
# Experimental feature for apt-listbugs: pass-through SOAP requests and
|
96
|
+
# responses to/from bugs.debian.org. If not set, default is true if
|
97
|
+
# ForceManaged is enabled and false otherwise.
|
98
|
+
# ForwardBtsSoap: 1
|
99
|
+
|
100
|
+
# The daemon has a small cache for DNS data, to speed up resolution. The
|
101
|
+
# expiration time of the DNS entries can be configured in seconds.
|
102
|
+
# DnsCacheSeconds: 3600
|
103
|
+
|
104
|
+
# Don't touch the following values without good consideration!
|
105
|
+
#
|
106
|
+
# Max. count of connection threads kept ready (for faster response in the
|
107
|
+
# future). Should be a sane value between 0 and average number of connections,
|
108
|
+
# and depend on the amount of spare RAM.
|
109
|
+
# MaxStandbyConThreads: 8
|
110
|
+
#
|
111
|
+
# Hard limit of active thread count for incoming connections, i.e. operation
|
112
|
+
# is refused when this value is reached (below zero = unlimited).
|
113
|
+
# MaxConThreads: -1
|
114
|
+
#
|
115
|
+
# Pigeonholing files with regular expressions (static/volatile). Can be
|
116
|
+
# overriden here but not should not be done permanently because future update
|
117
|
+
# of default settings would not be applied later.
|
118
|
+
# VfilePattern = (^|.*?/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.db(\.tar\.gz)?|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|metalink\?repo|.*prestodelta\.xml\.gz)$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.*
|
119
|
+
# PfilePattern = .*(\.d?deb|\.rpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$
|
120
|
+
# Whitelist for expiration, file types not to be removed even when being
|
121
|
+
# unreferenced. Default: many parts from VfilePattern where no parent index
|
122
|
+
# exists or might be unknown.
|
123
|
+
# WfilePattern = (^|.*?/)(Release|InRelease|Release\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.db\.tar\.gz|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.*
|
124
|
+
|
125
|
+
# Higher modes only working with the debug version
|
126
|
+
# Warning, writes a lot into apt-cacher.err logfile
|
127
|
+
# Value overwrites UnbufferLogs setting (aliased)
|
128
|
+
# Debug:3
|
129
|
+
|
130
|
+
# Usually, general purpose proxies like Squid expose the IP address of the
|
131
|
+
# client user to the remote server using the X-Forwarded-For HTTP header. This
|
132
|
+
# behaviour can be optionally turned on with the Expose-Origin option.
|
133
|
+
# ExposeOrigin: 0
|
134
|
+
|
135
|
+
# When logging the originating IP address, trust the information supplied by
|
136
|
+
# the client in the X-Forwarded-For header.
|
137
|
+
# LogSubmittedOrigin: 0
|
138
|
+
|
139
|
+
# The version string reported to the peer, to be displayed as HTTP client (and
|
140
|
+
# version) in the logs of the mirror.
|
141
|
+
# WARNING: some archives use this header to detect/guess capabilities of the
|
142
|
+
# client (i.e. redirection support) and change the behaviour accordingly, while
|
143
|
+
# ACNG might not support the expected features. Expect side effects.
|
144
|
+
#
|
145
|
+
# UserAgent: Yet Another HTTP Client/1.2.3p4
|
146
|
+
|
147
|
+
# In some cases the Import and Expiration tasks might create fresh volatile
|
148
|
+
# data for internal use by reconstructing them using patch files. This
|
149
|
+
# by-product might be recompressed with bzip2 and with some luck the resulting
|
150
|
+
# file becomes identical to the *.bz2 file on the server, usable for APT
|
151
|
+
# clients trying to fetch the full .bz2 compressed version. Injection of the
|
152
|
+
# generated files into the cache has however a disadvantage on underpowered
|
153
|
+
# servers: bzip2 compression can create high load on the server system and the
|
154
|
+
# visible download of the busy .bz2 files also becomes slower.
|
155
|
+
#
|
156
|
+
# RecompBz2: 0
|
157
|
+
|
158
|
+
# Network timeout for outgoing connections.
|
159
|
+
# NetworkTimeout: 60
|
160
|
+
|
161
|
+
# Sometimes it makes sense to not store the data in cache and just return the
|
162
|
+
# package data to client as it comes in. DontCache parameters can enable this
|
163
|
+
# behaviour for certain URL types. The tokens are extended regular expressions
|
164
|
+
# that URLs are matched against.
|
165
|
+
#
|
166
|
+
# DontCacheRequested is applied to the URL as it comes in from the client.
|
167
|
+
# Example: exclude packages built with kernel-package for x86
|
168
|
+
# DontCacheRequested: linux-.*_10\...\.Custo._i386
|
169
|
+
# Example usecase: exclude popular private IP ranges from caching
|
170
|
+
# DontCacheRequested: 192.168.0 ^10\..* 172.30
|
171
|
+
#
|
172
|
+
# DontCacheResolved is applied to URLs after mapping to the target server. If
|
173
|
+
# multiple backend servers are specified then it's only matched against the
|
174
|
+
# download link for the FIRST possible source (due to implementation limits).
|
175
|
+
# Example usecase: all Ubuntu stuff comes from a local mirror (specified as
|
176
|
+
# backend), don't cache it again:
|
177
|
+
# DontCacheResolved: ubuntumirror.local.net
|
178
|
+
#
|
179
|
+
# DontCache directive sets (overrides) both, DontCacheResolved and
|
180
|
+
# DontCacheRequested. Provided for convenience, see those directives for
|
181
|
+
# details.
|
182
|
+
#
|
183
|
+
# Default permission set of freshly created files and directories, as octal
|
184
|
+
# numbers (see chmod(1) for details).
|
185
|
+
# Can by limited by the umask value (see umask(2) for details) if it's set in
|
186
|
+
# the environment of the starting shell, e.g. in apt-cacher-ng init script or
|
187
|
+
# in its configuration file.
|
188
|
+
# DirPerms: 00755
|
189
|
+
# FilePerms: 00664
|
190
|
+
#
|
191
|
+
#
|
192
|
+
# It's possible to use use apt-cacher-ng as a regular web server with limited
|
193
|
+
# feature set, i.e.
|
194
|
+
# including directory browsing and download of any file;
|
195
|
+
# excluding sorting, mime types/encodings, CGI execution, index page
|
196
|
+
# redirection and other funny things.
|
197
|
+
# To get this behavior, mappings between virtual directories and real
|
198
|
+
# directories on the server must be defined with the LocalDirs directive.
|
199
|
+
# Virtual and real dirs are separated by spaces, multiple pairs are separated
|
200
|
+
# by semi-colons. Real directories must be absolute paths.
|
201
|
+
# NOTE: Since the names of that key directories share the same namespace as
|
202
|
+
# repository names (see Remap-...) it's administrators job to avoid such
|
203
|
+
# collisions on them (unless created deliberately).
|
204
|
+
#
|
205
|
+
# LocalDirs: woo /data/debarchive/woody ; hamm /data/debarchive/hamm
|
206
|
+
|
207
|
+
# Precache a set of files referenced by specified index files. This can be used
|
208
|
+
# to create a partial mirror usable for offline work. There are certain limits
|
209
|
+
# and restrictions on the path specification, see manual for details. A list of
|
210
|
+
# (maybe) relevant index files could be retrieved via
|
211
|
+
# "apt-get --print-uris update" on a client machine.
|
212
|
+
#
|
213
|
+
# PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages*
|
214
|
+
|
215
|
+
# Arbitrary set of data to append to request headers sent over the wire. Should
|
216
|
+
# be a well formated HTTP headers part including newlines (DOS style) which
|
217
|
+
# can be entered as escape sequences (\r\n).
|
218
|
+
# RequestAppendix: X-Tracking-Choice: do-not-track\r\n
|
219
|
+
|
220
|
+
# Specifies the IP protocol families to use for remote connections. Order does
|
221
|
+
# matter, first specified are considered first. Possible combinations:
|
222
|
+
# v6 v4
|
223
|
+
# v4 v6
|
224
|
+
# v6
|
225
|
+
# v4
|
226
|
+
# (empty or not set: use system default)
|
227
|
+
#
|
228
|
+
# ConnectProto: v6 v4
|
229
|
+
|
230
|
+
# Regular expiration algorithm finds package files which are no longer listed
|
231
|
+
# in any index file and removes them of them after a safety period.
|
232
|
+
# This option allows to keep more versions of a package in the cache after
|
233
|
+
# safety period is over.
|
234
|
+
# KeepExtraVersions: 1
|
235
|
+
|
236
|
+
# Optionally uses TCP access control provided by libwrap, see hosts_access(5)
|
237
|
+
# for details. Daemon name is apt-cacher-ng. Default if not set: decided on
|
238
|
+
# startup by looking for explicit mentioning of apt-cacher-ng in
|
239
|
+
# /etc/hosts.allow or /etc/hosts.deny files.
|
240
|
+
# UseWrap: 0
|
241
|
+
|
242
|
+
# If many machines from the same local network attempt to update index files
|
243
|
+
# (apt-get update) at nearly the same time, the known state of these index file
|
244
|
+
# is temporarily frozen and multiple requests receive the cached response
|
245
|
+
# without contacting the server. This parameter (in seconds) specifies the
|
246
|
+
# length of this period before the files are considered outdated.
|
247
|
+
# Setting it too low transfers more data and increases remote server load,
|
248
|
+
# setting it too high (more than a couple of minutes) increases the risk of
|
249
|
+
# delivering inconsistent responses to the clients.
|
250
|
+
# FreshIndexMaxAge: 27
|
251
|
+
|
252
|
+
# Usually the users are not allowed to specify custom TCP ports of remote
|
253
|
+
# mirrors in the requests, only the default HTTP port can be used (instead,
|
254
|
+
# proxy administrator can create Remap- rules with custom ports). This
|
255
|
+
# restriction can be disabled by specifying a list of allowed ports or 0 for
|
256
|
+
# any port.
|
257
|
+
#
|
258
|
+
# AllowUserPorts: 80
|
259
|
+
|
260
|
+
# Normally the HTTP redirection responses are forwarded to the original caller
|
261
|
+
# (i.e. APT) which starts a new download attempt from the new URL. This
|
262
|
+
# solution is ok for client configurations with proxy mode but doesn't work
|
263
|
+
# well with configurations using URL prefixes. To work around this the server
|
264
|
+
# can restart its own download with another URL. However, this might be used to
|
265
|
+
# circumvent download source policies by malicious users.
|
266
|
+
# The RedirMax option specifies how many such redirects the server should
|
267
|
+
# follow per request, 0 disables the internal redirection. If not set,
|
268
|
+
# default value is 0 if ForceManaged is used and 5 otherwise.
|
269
|
+
#
|
270
|
+
# RedirMax: 5
|
@@ -0,0 +1 @@
|
|
1
|
+
This cookbook is used with test-kitchen to test the parent, apt cookbok
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require File.expand_path('../support/helpers', __FILE__)
|
21
|
+
|
22
|
+
describe "apt_test::default" do
|
23
|
+
include Helpers::AptTest
|
24
|
+
|
25
|
+
it 'runs the cacher service' do
|
26
|
+
service("apt-cacher-ng").must_be_running
|
27
|
+
end
|
28
|
+
end
|
data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/default_test.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require File.expand_path('../support/helpers', __FILE__)
|
21
|
+
|
22
|
+
describe "apt_test::default" do
|
23
|
+
include Helpers::AptTest
|
24
|
+
|
25
|
+
it 'creates the preseeding directory' do
|
26
|
+
directory('/var/cache/local/preseeding').must_exist
|
27
|
+
end
|
28
|
+
end
|
data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/lwrps_test.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: lwrps
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require File.expand_path('../support/helpers', __FILE__)
|
21
|
+
|
22
|
+
describe "apt_test::lwrps" do
|
23
|
+
include Helpers::AptTest
|
24
|
+
|
25
|
+
it 'creates the Opscode sources.list' do
|
26
|
+
file("/etc/apt/sources.list.d/opscode.list").must_exist
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'adds the Opscode package signing key' do
|
30
|
+
opscode_key = shell_out("apt-key list")
|
31
|
+
assert opscode_key.stdout.include?("Opscode Packages <packages@opscode.com>")
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'creates the correct pinning preferences for chef' do
|
35
|
+
pinning_prefs = "Package: chef\nPin: version 10.16.2-1"
|
36
|
+
file("/etc/apt/preferences.d/chef").must_match(/#{pinning_prefs}/)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'creates a repo with an architecture' do
|
40
|
+
cloudera = "deb\s+\\[arch=amd64\\] http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh precise-cdh4 contrib"
|
41
|
+
file("/etc/apt/sources.list.d/cloudera.list").must_match(/#{cloudera}/)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'creates the correct pinning preferences with a glob' do
|
45
|
+
pinning_prefs = "Package: \\*\nPin: origin packages.dotdeb.org"
|
46
|
+
file("/etc/apt/preferences.d/dotdeb").must_match(/#{pinning_prefs}/)
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Helpers
|
21
|
+
module AptTest
|
22
|
+
require 'chef/mixin/shell_out'
|
23
|
+
include Chef::Mixin::ShellOut
|
24
|
+
include MiniTest::Chef::Assertions
|
25
|
+
include MiniTest::Chef::Context
|
26
|
+
include MiniTest::Chef::Resources
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: cacher-ng
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
include_recipe "apt::cacher-ng"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
include_recipe "apt::default"
|