커밋 그래프

54 commits

작성자 SHA1 메시지 날짜
Philipp Wagner
a02654e36c Look for correct sources.list.d file for apt::ppa
In Ubuntu 15.10 the path of the apt sources file, which is generated by
apt-add-repository, changed to include the distid. This breaks apt::ppa
idempotency, since it does not recognize the repository is already
added.

Reported on puppet-users as well:
https://groups.google.com/forum/#!topic/puppet-users/YzeMyZYUo98
2016-02-03 17:24:06 +01:00
Robert Drake
0dce05adae Add support for creating pins from main class
This lets you create apt::pin resources as an apt param hash.  It also
supplies appropriate tests and documentation.
2015-09-04 22:31:13 -04:00
Callahan, Michael Joseph
afa4d45ee9 Added an ensure parameter for user control of proxy presence. Defaults to undef to resist breaking any current setup.
added spec entry

Added validation

fixed ensure hash
2015-08-05 16:03:28 -04:00
Morgan Haskel
cd37fc34f2 MODULES-2190 - Fix anchor issues 2015-07-21 10:19:15 -07:00
Hunter Haugen
48152d4a89 Don't stub puppetversion
The puppetversion fact still needs to represent puppet's version that is being used to test
2015-05-06 15:10:05 -07:00
Morgan Haskel
21a2462a58 Compatibility for puppet < 3.5.0 2015-04-27 13:48:41 -07:00
Morgan Haskel
fff702270e Update tests to work with rspec-puppet 2.x
Also enable future parser testing. Need to allow failures with future
parser for now since none of the published gems have the fix for
PUP-4379
2015-04-22 16:40:48 -07:00
Morgan Haskel
3a20254108 Don't purge by default. That seems unnecessarily destructive. 2015-04-14 11:03:17 -07:00
Morgan Haskel
dc746734f1 Merge remote-tracking branch 'upstream/master' into merge_master_to_next 2015-03-25 18:32:09 -04:00
Morgan Haskel
df47ca7ff4 Remove update['always'] = true support
We don't really need both of `update['always'] = true` and
`update['frequency'] = 'always'`.
2015-03-18 13:52:12 -07:00
Patrick Gansterer
61a4fb6979 Fix gpg key checking warings after f588f26
Use the full fingerprint for all keys to silence the warning.
2015-03-16 19:34:24 +01:00
Daniele Sluijters
a220dcf08c apt::source: Merge include_* options into hash.
This makes its behaviour similar to the `update`, `proxy` and `purge`
hashes on the main classes bringing its API more in line with the rest
of the module.
2015-03-05 17:37:51 +01:00
Daniele Sluijters
c57d2dd5dd apt: Fix all strict variable cases.
A few of these fixes are absolutely horrendous but we have no choice as
we need to stay current- and future-parser compatible for now.

Once we can go Puppet 4 only we can use the `$facts` hash lookup instead
which will return undef/nil for things that aren't set instead of them
not being defined at all.
2015-03-03 17:33:14 +01:00
Daniele Sluijters
ea4f615735 apt::source: Allow passing in a complex key.
Turn `$key` into something that accepts a string or a hash of four keys
representing the different options that can be passed on to `apt::key`.
2015-03-01 14:40:17 +01:00
Daniele Sluijters
0f3bdcdf5a apt(::key|_key) Remove the key.*_ prefixes.
Remove a lot of the redundant `key_` prefixes on `apt::key` and the
`keyserver_` prefix on `apt_key`.
2015-03-01 14:20:46 +01:00
Daniele Sluijters
95ae9ab48f apt: Add settings, keys and ppas.
* Allow any configuration of apt to be done through data bindings by
  passing in hashes representing the resources.
* Switch apt::ppa to use `distid` as set in `apt::params. This makes
  `apt::ppa` also work for LinuxMint.
2015-03-01 14:20:45 +01:00
Daniele Sluijters
fe228435b1 apt: Change how update is managed.
* Instead of having 4 options controlling purging we now have a single
  hash with four possible keys.
* Include `apt::update` only _after_ we've assembled the `$_update`
  hash.
2015-03-01 13:17:47 +01:00
Daniele Sluijters
a1ce8bdea4 apt: Change how purging is managed.
* Instead of having 4 options controlling purging we now have a single
  hash with four possible keys.
* We purge everything by default.
* `/etc/apt/preferences` is now always managed.
* Add missing `mode` to some of the files.
2015-02-28 16:50:31 +01:00
Daniele Sluijters
d81c3d9476 apt: Add proxy support on the class.
Re-introduce proxy support at the class level. Needing to configure a
proxy is such a common scenario that having it on the class is a
reasonable thing. It also affects `apt::ppa`.

Change `apt::ppa` to no longer have its own `proxy` parameter but use
the proxy as configured on the main `apt` class.
2015-02-27 21:14:24 +01:00
Daniele Sluijters
b53ea1b90c spec/(apt|ppa): Enough with all the strings.
Most options can and should be named through symbols, makes it much
easier to read too with syntax highlighting.
2015-02-27 12:20:41 +01:00
Morgan Haskel
0475e50be8 Make apt::setting notify Exec['apt_update'] by default
Can be disabled by setting `notify_update => false`
2015-02-26 12:44:06 -08:00
Morgan Haskel
351c8d5941 Convert to use apt::setting instead of file resources
This adds consistency across the module
2015-02-25 10:24:56 -08:00
Morgan Haskel
1139f801eb Convert specs to RSpec 3.1.7 syntax with Transpec
This conversion is done by Transpec 3.0.8 with the following command:
    transpec spec/classes spec/defines spec/unit

* 87 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 14 conversions
    from: obj.should
      to: expect(obj).to

* 7 conversions
    from: == expected
      to: eq(expected)

* 1 conversion
    from: it { should_not ... }
      to: it { is_expected.not_to ... }

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2015-02-24 13:20:29 -08:00
Morgan Haskel
10f313cfb4 Convert apt::source to use apt::setting
May as well use the define since we added it
2015-02-21 15:26:48 -08:00
Morgan Haskel
0a178c3382 Cleanup for apt::source
* Update `release` to default to `$::lsbdistcodename`
* Default `include_src` to false
* Validate more things!
* Stop redefining variables from `apt::params`
2015-02-21 15:26:48 -08:00
Morgan Haskel
bb3a1f0af0 Remove required packages
I'm not entirely clear on the history behind this feature, and this
feels sort of hack-y. If you could explain why this is needed that would
be awesome, or if it isn't just merge this :)
2015-02-19 15:39:14 -08:00
Morgan Haskel
61080fb676 Unbreak broken tests 2015-02-15 09:39:17 -08:00
Stefan Dietrich
443db5a7c2 (MODULES-1200) Fix inconsistent header across files 2015-02-06 21:16:05 +01: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
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
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
Henrik Ahlgren
eb40a7ae78 Make apt.conf.d/proxy world readable and add a newline 2014-02-25 19:57:10 +02: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
4d188443bc Add lsbdistid facts where appropriate. 2014-02-24 22:31:16 +00: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
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
Dean Reilly
d8e2cf24a5 Add spec test for removing proxy configuration. 2013-06-02 18:51:27 +01:00
Thomas Broyer
0ffe484c7c Move Package['python-software-properties'] to apt:ppa
Also updates the apt-update in Apt::Ppa to use $apt::params::provider
instead of aptitude.
2012-05-04 13:46:08 -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
Thomas Broyer
e656c65818 Make sure we configure the proxy before doing apt-get update. 2012-03-30 17:48:31 +02:00
Ken Barber
a758247f26 (#13289) Clean up style violations and fix corresponding tests 2012-03-21 13:21:11 +00:00
Ryan Coleman
b1eb28956e Merge pull request #23 from haus/python_properties
Check if python-software-properties is defined before attempting to define it.

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-02-24 11:20:52 -08:00
Ryan Coleman
be2cc3ec1b (#12522) Adjust spec test for splitting purge
Now that the purge parameter is split into two, the spec test needs
adjusted. This commit makes that adjustment.
2012-02-24 10:17:26 -08:00
Matthaus Litteken
8acb202685 Add test for python-software-properties package
This test adds the precondition that the python-software-packages package be
installed before the apt class is synced. If the defined function were not
called around the package resource, this test would fail with a duplicate
package resource error.
2012-02-23 21:40:42 -08:00
William Van Hevelingen
1160bcd6d1 (#12526) Add ability to reverse apt { disable_keys => true }
The setting `disable_keys => true` parameter in the apt module creates
/etc/apt/apt.conf.d/99unauth with the contents
"APT::Get::AllowUnauthenticated 1;". Changing `disable_keys`
does not remove this file. This patch makes it so that
`disable_keys => false` will remove /etc/apt/apt.conf.d/99unauth.
2012-02-23 14:37:04 -08:00