Commit graph

34 commits

Author SHA1 Message Date
Stefan Dietrich
443db5a7c2 (MODULES-1200) Fix inconsistent header across files 2015-02-06 21:16:05 +01:00
Morgan Haskel
3d25c08ec1 Trusted will be a reserved word in Puppet 4
Rename the new `trusted` parameter to `trusted_source`.
2015-01-21 10:54:37 -08:00
Merritt Krakowitzer
4f0ebaced7 Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-apt into f3792625/trusted_param 2015-01-20 21:27:52 +02:00
Merritt Krakowitzer
38582d02cd Add support for parameter trusted
* Add support for paramater trusted, valid options are 'true' and false.
defaults to false. True sets the value to trusted=yes.

trusted=yes can be set to indicate that packages from this source are
always authenticated even if the Release file is not signed or the
signature can't be checked.

* Update documentation
2015-01-13 17:41:20 +02:00
rfkrocktk
445ad0b6fe Allow full length GPG key fingerprints.
Also add support for ECC and ECDSA key_types
2015-01-10 00:45:57 -05:00
Wolf Noble
7a192d7bea - add bits for updating apt
- fix spec tests to include osfamily fact
- add spec tests to verify current default behavior unimpacted.
- manage the update-stamp file in puppet via content rather than a served file.
- update custom fact to return -1 if the file doesn't exist
- add spec test for custom fact
- refactor to use a variable vs a collector/override
- document parameters a bit more verbosely
- remove empty unconstrained fact
- Add osfamily fact to backports tests to facilitate functional tests on non-debian hosts
2014-09-24 16:29:27 -07:00
Morgan Haskel
d6bdb4d925 Cleaned up unit tests. 2014-08-04 19:44:19 -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
juniorsysadmin
986bf8b02d Allow custom comment for sources list 2014-06-10 17:05:51 +10: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
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
Ashley Penney
4d188443bc Add lsbdistid facts where appropriate. 2014-02-24 22:31:16 +00: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
lkoranda
7dd4a14848 Fixed tests for cf04f76 2013-10-14 14:27:17 +02:00
Hunter Haugen
46d47f79d2 Merge pull request #118 from opeckojo/apt-sources-arch
Add optional architecture qualifier to apt-sources
2013-07-02 11:48:06 -07:00
Francois Deppierraz
37a0dcd0b6 Install required_packages before 'apt-get update'
This is necessary when required_packages contains GPG keys that are used for
authenticating other packages. Tested with package ubuntu-cloud-keyring which
is included in Ubuntu main and used by the Ubuntu Cloud Archive.

I think the same problem applies to other *-keyring packages as well.
2013-06-03 09:57:58 +00:00
Joe O'Pecko
b3d67c8937 Add optional architecture qualifier to apt-sources 2013-06-02 11:55:36 -07:00
Steffen Zieger
d49dbb49ae fix check of release parameter 2012-07-10 01:39:53 +02:00
Branan Purvine-Riley
7450a5ffc0 Fix the spec test for apt::source
the $location paramater is meant to be a deb location, so it should be
formatted as a URI.
2012-05-25 15:32:49 -07:00
Branan Purvine-Riley
ebd05e5c51 Fix spec tests 2012-05-25 11:23:54 -07:00
Nan Liu
f13f3cfac7 (#11966) Change apt update to apt_update.
Based on code review change exec from apt update to apt_update.
2012-05-04 13:35:25 -07:00
Nan Liu
3684f88372 (#11966) Only invoke apt-get update once.
Move apt-get update exec to a seperate class to minimize the number of
apt-get updates invoked by configuration changes.

* remove apt_update exec resource in apt class.
* remove apt-get-${name} in defines.
* apt::source notify Exec['apt update'].
* Remove dependency to Exec['apt_update'].
* fix rspec-puppet tests.

Conflicts:

	manifests/source.pp
2012-05-04 13:35:13 -07:00
Nan Liu
effb3f7ff3 (#14308) Add ensure=>absent for define resource.
Several apt::* define resource type does not support ensurable. This
update allows ensure=>absent to support the removal of these
configuration files.

* apt::conf
* apt::pin
* apt::source
2012-05-03 16:59:13 -07:00
Ken Barber
a758247f26 (#13289) Clean up style violations and fix corresponding tests 2012-03-21 13:21:11 +00:00
Reid Vandewiele
d4fec561f3 Modify apt::source release parameter test
This commit modifies the release parameter test in apt::source to work
correctly within puppet-rspec for edge-case resource definitions. Previously,
the test for the $release parameter was written as

`if ! $release { fail() }`

This commit updates the test to be written as

`if $release == undef { fail() }`

Additionally, the tests for correct behavior in the presence or absence of a
$release parameter have been beefed up.

The reason for making this change relates to examples such as the following
resource definition:

apt::source { "jenkins":
  location    => "http://pkg.jenkins-ci.org/debian",
  release     => "",
  repos       => "binary/",
  key         => "D50582E6",
  key_source  => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
  include_src => false,
}

Note that the $release parameter is given as the empty string. In practice,
this is perfectly valid and everything will work great. However, it seems that
the empty string gets interpreted by something in puppet-rspec as something
equivalent to "False", and thus when testing, the above resource definition
would fail with "Puppet::Error: lsbdistcodename fact not available: release
parameter required" even though the $release parameter has been explicitely
specified (as the empty string).

See also: https://github.com/rtyler/puppet-jenkins/issues/9
2012-03-07 10:10:46 -08:00
Ryan Coleman
76dbf992e0 Merge pull request #26 from pdxcat/ticket_12823_aptkey_defined_type
(#12823) Add apt::key defined type and modify apt::source to use it

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-03-01 14:40:44 -08:00
Reid Vandewiele
8cdaf855a1 (#12823) Add apt::key defined type and modify apt::source to use it
Adding this defined type allows puppet to add keys to the apt keystore without
needing to add a corresponding source; it also adds the "key_source" parameter
for wget'ing keys from arbitrary URLs, and allows for keys to be explicity
removed.

apt::key allows a key to be ensured present multiple times to account for
apt::source resources that all reference the same key. However, this means
that it is possible for a given key to be defined multiple times with
differing source parameters. e.g.

apt::key { "Add key: 4BD6EC30 from Apt::Source bunny":
  key        => "4BD6EC30",
  key_server => "pgp.mit.edu",
}

apt::key { "Add key: 4BD6EC30 from Apt::Source rabbit":
  key        => "4BD6EC30",
  key_server => "keyserver.ubuntu.com",
}

The defined type will accept both definitions and will create multiple exec
resources. This was deemed preferable to the alternative (creating only one
exec resource) in that one broken definition won't hose an entire catalog. If
one definition fails to install the key because of a bad "key_server", the
next apt::key that uses the key will get it done.
2012-03-01 14:15:52 -08:00
William Van Hevelingen
7c0d10b392 (#12809) $release should use $lsbdistcodename and fall back to manual input
This commit changes $release to default to Facter's $lsbdistcodename
and fall back to a Parse Error if $release is not set and $lsbdistcodename
does not exist. Previously $release was hardcoded to karmic.

This commit also modifies apt::ppa to use $release and sets the
files to be ensured so that they are not purged when purge_sources_list_d
is set to true.
2012-03-01 11:15:02 -08:00
Ryan Coleman
fab62e6de7 Merge pull request #22 from haus/unique_required_packages
Allow duplicate required_packages between sources

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-02-24 11:12:39 -08:00
Matthaus Litteken
9059c4e2a8 Fix source specs to test all key permutations
Previously only one should in each block was being evaluated. This moves each
should to its own block so that all values are tested. It also adds another set
of params so that all useful permutations of key, key_server, and key_content
are generated. It also replaces the previous ternary assignment for param_set
with a hash merge.
2012-02-23 22:14:38 -08:00
Matthaus Litteken
1dcbf3d303 Add tests for required_packages change
This updates the tests for the apt::source defined type to use the new name for
the exec resource and the new parameter for the same exec.
2012-02-23 21:04:57 -08:00
Matthaus Litteken
74c8371533 (#12430) Add tests for changes to apt module
This update reflects the changes to the apt module to allow duplicate keys. It
mostly involves tests for changes to the resource names to make them unique
between defines.
2012-02-23 20:51:27 -08:00
Matthaus Litteken
d522877cdd (#12094) Replace chained .with_* with a hash
The hash passing to the with method is cleaner and closer to puppet code, so
all of the with_$param have been replaced with with($hash). This also
includes two minor whitspace changes to unstable.pp and source.pp.
This also replaces the ternary switch on param_set with a hash merge,
which is cleaner and will support more use cases.
2012-02-08 09:24:43 -08:00
Matthaus Litteken
2d688f4cdc (#12094) Add rspec-puppet tests for apt
This commit adds full coverage for the apt module as it currently exists. It
adds rspec-puppet tests for the defines (apt::builddep, apt::force, apt::pin,
apt::ppa, apt::source) and classes (apt, debian::testing, debian::unstable,
apt::params, apt::release).
2012-01-23 13:37:42 -08:00