Commit graph

227 commits

Author SHA1 Message Date
Morgan Haskel
442ca30870 Don't hardcode /etc/puppet as the puppetpath. 2014-08-12 16:10:36 -04:00
Morgan Haskel
c69fb2cd24 Clean up test failures 2014-08-12 13:45:37 -04:00
Morgan Haskel
5d7982dba0 Cleaned up unit tests. 2014-08-12 12:09:04 -04:00
Morgan Haskel
ce846d0118 Cleaned up acceptance tests
A lot of the tests were testing things that really should be tested via
unit tests, so those were deleted and unit tests will be revamped to
make sure they are covering everything they need to be covering.

Conflicts:
	spec/acceptance/unattended_upgrade_spec.rb
2014-08-12 12:09:04 -04:00
Morgan Haskel
08043adb75 Sometimes killing apt is too aggressive. 2014-08-12 12:09:04 -04:00
Morgan Haskel
d6bdb4d925 Cleaned up unit tests. 2014-08-04 19:44:19 -04:00
Morgan Haskel
4ed9cb5099 Cleaned up acceptance tests
A lot of the tests were testing things that really should be tested via
unit tests, so those were deleted and unit tests will be revamped to
make sure they are covering everything they need to be covering.
2014-08-04 19:20:07 -04:00
Morgan Haskel
e970aa9a6d Merge pull request #333 from wilman0/master
Fix for debian/ubuntu hold and a way to add debian src only
2014-07-31 12:58:20 -04:00
wilman0
538a9f9aab Update hold.pp
fix for default debian installations

all files in /etc/apt/preferences without _ will be silently ignore according to debian manpage. Addionally its not a good idea to write versionnumber in filename cause there is no way to delete this files if you increase versionumber

Update source_spec.rb

add a way to include debsrc only (useful for debian/ubuntu build server ... jenkins ect)

Update source_spec.rb

var rename

Update source.list.erb

add include_deb "switch"

Update source.pp

"include_deb" defaultvalue = true

Update hold_spec.rb

change the name of the preferences file (hold)

Update source_spec.rb

Update README.md

Doku: 'include_deb' included next to 'include_src' in examples

Update README.md

typo
2014-07-31 18:40:46 +02:00
Morgan Haskel
66e05edbe7 Debian seems to have hanging apt-get and/or dpkg processes, so kill
those.
2014-07-30 14:40:20 -04:00
Morgan Haskel
f02f9b8465 Fix broken acceptance tests.
New fact was added that matched a regex breaking the always_apt_update
tests.  Updated the tests to check for the apt_update exec, not just the
string apt_update.
2014-07-30 12:03:09 -04:00
Spencer Owen
64b8eb1e4a Adds check to params.pp if lab-release is not installed
Adds spec test

If lab-release is not installed, then the end user sees a confusing/ vague message
Error: Unsupported lsbdistid () at /modules/apt/manifests/params.pp:52
It is common for docker containers to not include this package by default

After fix, the user sees a friendlier message if lab-release is not installed
Error: Unable to determine lsbdistid, is lsb-release installed? at /modules/apt/manifests/params.pp:52
2014-07-10 11:48:54 -06:00
Ashley Penney
3c48598eeb Merge branch '1.5.x' into merge
Conflicts:
	Gemfile
	spec/acceptance/apt_key_provider_spec.rb
2014-07-03 13:08:11 -04:00
Daniele Sluijters
4ee69d08f4 Merge pull request #321 from raoulbhatia/squeeze-lts
Enable auto-update for Debian squeeze-lts
2014-06-27 17:41:50 +02:00
Daniele Sluijters
943be409bd Merge pull request #319 from cloudbuy/master
add facts showing available updates
2014-06-27 14:28:19 +02:00
Damien Churchill
7eb9d00360 add facts showing available updates
Making use of the apt-check command from the 'update-notifier-common'
package (if available) display the number of available updates, number of
security updates as well as the update package names.
2014-06-27 11:21:58 +01:00
Raoul Bhatia
5ed7396a31 Enable auto-update for Debian squeeze-lts
Quoting https://wiki.debian.org/LTS

Official security support for Debian GNU/Linux 6.0
(code name "Squeeze") has ended on 31 May 2014.
However long term support for the distribution
is going to be extended until February 2016,
i.e. five years after the initial release.

See https://wiki.debian.org/LTS for more details.
2014-06-26 20:03:04 +02:00
Ashley Penney
12704eae47 Merge pull request #316 from cmurphy/master
Start synchronizing module files
2014-06-26 13:53:18 -04:00
Daniele Sluijters
345aef1d01 Merge pull request #304 from innyso/allow_url_for_key_server
Allow url for key server
2014-06-26 14:29:36 +02:00
Colleen Murphy
fd1e2ec12c Sync files 2014-06-25 17:23:12 -07:00
Morgan Haskel
1e1c8b287a Add test case to ensure graceful failure on OSX. 2014-06-11 13:31:53 -04:00
juniorsysadmin
986bf8b02d Allow custom comment for sources list 2014-06-10 17:05:51 +10:00
innyso
3cbe24e18e Adding dash to key_server validate regex
Dashes should be allow when defining domain or url for key_server. Rspec
test cases are included to make sure no malform domain name or url are
used.
2014-06-10 01:07:04 +01:00
innyso
1a3d6625f4 Allow url or domain name for key_server parameter
As some places dont have port 11371 open, they are required to use URL as
key_server instead of domain name therefore adding the capability to use URL or
domain name as key_server parameter
2014-06-02 18:05:20 +01:00
Morgan Haskel
199bd52cf3 Merge pull request #303 from apenney/fix-ubuntu-10-tests
Fix the tests for Ubuntu 10.04.
2014-05-29 13:08:15 -04:00
Ashley Penney
ec07797399 Fix the tests for Ubuntu 10.04. 2014-05-29 13:05:51 -04:00
Ashley Penney
6697a9c971 Merge pull request #297 from frconil/sourceslist-comment
adding notice on top of sourceslist files
2014-05-22 10:42:15 -07:00
Ashley Penney
8e0887cafb Merge branch '1.5.x' of https://github.com/puppetlabs/puppetlabs-apt into 1.5.x 2014-05-21 11:19:04 -07:00
Ashley Penney
ba074344fe Merge pull request #300 from apenney/fix-tests
Block this from running on unsupported platforms.
2014-05-21 10:39:46 -07:00
Ashley Penney
71ebb94283 Block this from running on unsupported platforms. 2014-05-21 10:38:24 -07:00
Morgan Haskel
b2381c6673 Fixing lint and adding the trusty nodeset (not sure how that was missed) 2014-05-20 16:24:28 -04:00
François Conil
3fad56d266 adding notice on top of sourceslist files
Useful to figure out what is managed by puppet and what isn't when
 not setting up the option to purge sourceslist files
2014-05-19 15:24:42 +10:00
Morgan Haskel
0da464de35 Merge pull request #287 from oc243/master
Implement fancy progress bars configuration.
2014-05-15 13:45:46 -04:00
Oliver Chick
2cdcd3b06d Implement fancy progress bars configuration.
Ubuntu 14.04 ships with apt 0.9.15, has a ``fancy progress bar'', which
is a green bar that shows at the bottom of the terminal showing progress
throughout install.

This patch enables the progress bar, which is usually done by running
echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar
2014-05-14 12:02:37 +01:00
Daniel Paulus
15630989da Fixed acceptance spec and add debian nodeset 2014-05-05 11:57:42 +02:00
Daniel Paulus
c327d3d7bf Testing if we are not touching the preference file when purge mode is off 2014-05-03 00:13:17 +02:00
Daniel Paulus
e337a24389 Remove the preference file for all supported platforms when in purge mode 2014-05-02 23:35:54 +02:00
Johan Fleury
9e789255c8 Writing proxy configuration in apt.conf.d/01proxy.
This commit changes the proxy file name to be more consistent with other files
in `apt.conf.d`. The old file (`apt.conf.d/proxy`) is removed.

Tests has been updated.
2014-04-11 13:56:29 +02:00
Ashley Penney
dfa3a62bd8 Merge pull request #280 from daenney/fix-pin-comments
Fix pin comments
2014-04-03 13:59:51 -04:00
Daniele Sluijters
fefd530362 unattended-upgrades: Fix origins for Squeeze.
Because Squeeze is now oldstable we need to add an oldstable line too
otherwise security updates won't be picked up. This is still because we
can't match on codename.
2014-04-02 11:17:04 +02:00
Daniele Sluijters
9f59f1b33a pin: Fix the template.
In APT preferences files the only allowed comments are lines that start
with `Explanation:`, commented lines that start with a # trigger a
myriad of interesting bugs. This is considered a feature of APT.

Because we're only ever writing a single file at a time with only a #
comment at the top we were getting away with this but it shouldn't be
there in the first place.
2014-03-28 08:47:19 +01:00
Daniele Sluijters
eaebe2f82d unattended_upgrades: Fix matching security archive
The default configuration we were writing for Debian was only working
for Squeeze, from Wheezy and onwards this wasn't working anymore. This
has to do with the fact that we should now be using Origins-Pattern
according to the unattended-upgrades docs. However, Ubuntu didn't
entirely get with the program yet...

This change reflects the defaults that unattended-upgrade installs on
every platform we support. In order to do so the unattended-upgrades
Debian archive for Squeeze, Wheezy, Lucid, Precise and Trusty were
downloaded and the default /etc/apt/apt.conf.d/50unattended-upgrades
checked for its content with regard to using Allow-Origins or
Origins-Pattern.

Fixes #277
2014-03-27 13:56:25 +01:00
Daniele Sluijters
ed52e513db backports: Allow setting a custom priority.
The module used to always pin backports to a priority of 200. This
default is still retained but is now configurable.

Additionally the default is now an Integer, not a 'quoted Integer' and
the tests have been updated to reflect this. This matters for future
parser as it will now kick people if they pass in a stringified integer
as priority.
2014-03-26 19:10:37 +01:00
Hunter Haugen
6691c2fade Merge pull request #248 from electrical/fix_params_fail
Fix fail message
2014-03-07 10:00:58 -08:00
Richard Pijnenburg
4d0bf7cbab Fail early when its not debian or ubuntu ( or debian like distro ) 2014-03-07 16:03:44 +01:00
Hunter Haugen
a35c30fe4b Merge pull request #209 from pabl0/proxy
Make apt.conf.d/proxy world readable and add a newline
2014-03-05 11:15:26 -08:00
Hunter Haugen
de095a173f Merge pull request #249 from ghoneycutt/define_apt_source_in_hiera
Add ability to specify hash of apt sources in hiera
2014-03-05 11:06:43 -08:00
Ashley Penney
3917e080f3 Merge pull request #259 from daenney/apt-hold
apt::hold: Add a mechanism to hold a package.
2014-03-05 13:16:38 -05:00
Daniele Sluijters
b560fa265f pin: Replace invalid chars with _ in file names.
This needs to be merged for #259 to work.
2014-03-05 19:11:13 +01:00
Daniele Sluijters
519babcfb6 apt::hold: Add a mechanism to hold a package.
I am aware this can be done with `dpkg --set-selections`, `apt-mark`
or `ensure => 'held'` on a package resource. The changes to the README
include the full rationale for wanting another mechanism.
2014-03-05 10:13:42 +01:00
Daniele Sluijters
5790341890 apt:🔑 Redo apt::key, make it use apt_key.
Introducing a totally rewritten and tested apt::key. This commit also
patches the spec's of apt::source because it was passing in data that
is no longer allowed by the new validation rules in apt::key.

It does its best to not touch any other specs and where we touch them
only minimally to ensure that we're not introducing breaking changes.
2014-03-04 16:39:58 +01:00
Richard Pijnenburg
440484d26a Add spec test to test for failure 2014-02-27 10:23:11 +01:00
Hunter Haugen
fd3e07e58f Merge branch '1.4.x' 2014-02-26 14:13:57 -08:00
Daniel Tremblay
46606c9a2b Add ability to specify hash of apt sources in hiera
This patch uses create_resources() to call apt::source which lets you
specify your sources in hiera.
2014-02-26 09:15:37 -05:00
Hunter Haugen
0a645c53ff Pin quotes were removed for a Lucid bugfix 2014-02-25 11:34:12 -08:00
Henrik Ahlgren
eb40a7ae78 Make apt.conf.d/proxy world readable and add a newline 2014-02-25 19:57:10 +02:00
Martin Konrad
2a2620f597 Update out-of-date Debian signing key in remaining files.
(cherry picked from commit 3aa293a53f)
2014-02-25 09:47:37 -08:00
Matt Callaway
bffef4142a Update pin_spec test to match quote removal.
(cherry picked from commit d28dc494aa)
2014-02-25 09:43:47 -08:00
Hunter Haugen
1853951c0f Merge pull request #226 from mark0n/master
Update out of date Debian signing key for backports
2014-02-25 09:34:00 -08:00
Hunter Haugen
7875745a8b Merge pull request #216 from genome-vendor/master
Remove the quotes from the "origin" line.
2014-02-25 09:29:15 -08:00
Hunter Haugen
cb53175dbb Merge pull request #229 from daenney/apt-key-ftp
apt_key: Support fetching keys over FTP.
2014-02-25 09:27:51 -08:00
Hunter Haugen
01cff19fa8 Merge pull request #240 from daenney/manage-preferences
apt: Allow managing of preferences file.
2014-02-25 09:25:49 -08:00
Ashley Penney
450fadb86a Add lsbdistid facts where appropriate.
(cherry picked from commit 4d188443bc)
2014-02-24 17:17:17 -08:00
Ashley Penney
4d188443bc Add lsbdistid facts where appropriate. 2014-02-24 22:31:16 +00:00
Ashley Penney
0a93286ff8 Merge pull request #241 from hunner/add_unsup
Add non Debian os family unsupported test.
2014-02-24 16:53:41 -05:00
Hunter Haugen
f6816c6bb3 Add non Debian os family unsupported test. 2014-02-24 13:52:13 -08:00
Hunter Haugen
944f9d5064 Merge branch '1.4.x' 2014-02-24 13:36:48 -08:00
Daniele Sluijters
2ca97c8210 apt: Allow managing of preferences file.
We already had a feature to manage and purge entries in preferences.d
but not the preferences file in /etc/apt. This commit adds that
capability.

Fixes #199
2014-02-22 11:00:22 +01:00
Hunter Haugen
afeaf57126 Use smaller build-dep package 2014-02-21 11:55:16 -08:00
Hunter Haugen
e2b7ef2da2 Using rspec filters works better
And this will make merging back to master cleaner
2014-02-21 11:45:21 -08:00
Hunter Haugen
d0b8ed8f64 Merge pull request #237 from hunner/change_port
Port 8080 is a bad choice and bumps into puppetdb
2014-02-21 11:32:10 -08:00
Hunter Haugen
8453d40138 Missed the - for -y, but also tests were missing lsbdistid 2014-02-21 09:34:46 -08:00
Daniele Sluijters
c3b3f5bb42 apt_key: Support fetching keys over FTP. 2014-02-21 09:06:47 +01:00
Hunter Haugen
904fb4a293 Don't pass options to ppa on lucid
Lucid (10.04) has `add-apt-repository` but it doesn't accept any
options. The define defaulted to `-y` but this changes that on lucid.

This was made 7 months ago, so apparently no one cares about 10.04 any
more.
2014-02-20 16:43:48 -08:00
Ashley Penney
296fdd2173 Make sure we handle PE properly. 2014-02-19 20:01:12 +00:00
Ashley Penney
bafc11df76 Make sure we handle PE properly. 2014-02-19 19:52:05 +00:00
Martin Konrad
3aa293a53f Update out-of-date Debian signing key in remaining files. 2014-02-18 16:57:01 -05:00
Daniele Sluijters
374101612c Add a type and provider to manage apt keys.
This commits introduces:
 * The apt_key type;
 * The apt_key provider;
 * Unit tests for the type;
 * Beaker/acceptance tests for the type/provider.

The idea behind apt_key is that apt::key will simply become a wrapper
that uses apt_key. Being a native type/provider apt_key is a lot less
error prone than the current exec behaviour of apt::key and adds a few
nice bonuses like inventory capabilities for mcollective users.
2014-02-18 22:51:08 +01:00
Matt Callaway
d28dc494aa Update pin_spec test to match quote removal. 2014-02-18 08:08:19 -06:00
Daniele Sluijters
ffe55a9758 beaker: Randomize SSH port. 2014-02-16 14:51:39 +01:00
Daniele Sluijters
ef7d149d5a apt::pin: Allow for packages to be an array. 2014-02-16 14:51:39 +01:00
Hunter Haugen
3be1f4323f Merge pull request #224 from hunner/change_port
Port 8080 is a bad choice and bumps into puppetdb
2014-02-14 16:40:13 -08:00
Hunter Haugen
80ea5a72ca Port 8080 is a bad choice and bumps into puppetdb 2014-02-14 16:17:44 -08:00
Hunter Haugen
4b8aa9e55a Revert "Undo backwards-incompatible changes and features."
This reverts commit f9e2fe2a7c.
2014-02-14 14:49:43 -08:00
Hunter Haugen
398309fc37 Enforce dependency version in tests 2014-02-14 14:34:37 -08:00
Hunter Haugen
3876813845 Add foss types to nodesets 2014-02-14 14:34:08 -08:00
Hunter Haugen
f9e2fe2a7c Undo backwards-incompatible changes and features.
Undoes the parameter changes in #140 and #184
2014-02-14 14:33:30 -08:00
Ashley Penney
1ce7dbb4c3 Merge pull request #208 from apenney/ppa-debian
Ensure apt::ppa fails on non-Ubuntu.
2014-01-09 15:28:20 -08:00
Ashley Penney
04ca249ee0 Fixes to make the tests run under Debian as well as Ubuntu. 2014-01-09 18:26:32 -05:00
Ashley Penney
558954bedf Ensure apt::ppa fails on non-Ubuntu. 2014-01-09 14:35:17 -05:00
Ashley Penney
c2f0ed219e Improve apt::force tests and ensure cleanup happens consistently. 2014-01-09 14:26:59 -05:00
Ashley Penney
16e57d4e45 Add additional acceptance testing.
This work adds a test for every parameter in every class/define in apt.
2014-01-09 12:09:22 -05:00
Ashley Penney
661c6731d7 Convert existing tests over to beakr-rspec. 2014-01-06 17:39:48 -05:00
Ryan Tandy
38c0208673 change include_class to contain_class in specs
include_class was deprecated starting from rspec-puppet 1.0.0.
2013-12-06 08:33:05 -08:00
Ashley Penney
9d32257f85 Merge pull request #188 from sd63/fix_regex_warning
escape more braces properly
2013-12-03 14:54:25 -08:00
Marco Nenciarini
935d3ce15b Fix the name of sources.list.d file resource in apt::ppa 2013-12-02 13:40:22 +01:00
Ryan Tandy
0001a03cd9 escape more braces properly
Fixes a couple of rspec regex warnings.
2013-11-21 09:37:11 -08:00
Stefan van Wouw
67e8968fe0 Fixed tests for fe594950c5
We actually expect an extra space. The previous build failed because a test is issued for location='', which indeed results in 2 spaces between the architecture specification and the release. According to the sources.list man page a location is always required though (unlike the missing/empty location in the :default_params of the source_spec test).
2013-10-23 12:29:47 +02:00
Ashley Penney
d1e87d4774 Merge pull request #140 from hunner/apt_force
Handling of release parameter and apt provider in force manifest
2013-10-15 10:45:17 -07:00
lkoranda
7dd4a14848 Fixed tests for cf04f76 2013-10-14 14:27:17 +02:00