Commit graph

1042 commits

Author SHA1 Message Date
Johan Fleury
31f732e789 Cleaning 50unattended-upgrades.erb 2015-03-09 00:01:57 +01:00
Morgan Haskel
481846b030 Merge pull request #453 from puppetlabs/daenney/location-required
apt::source: Make location required.
2015-03-06 10:08:02 -08:00
Daniele Sluijters
41a2725683 apt::source: Make location mostly required.
In what universe does it make sense to create a `sources.list.d` entry
for a repository **without** specifying where this repository is?
😖

😞 😩 😧 😱

Only when removing the resource should a location not be required.
2015-03-06 17:40:45 +01:00
TP Honey
b473af1ec5 Merge pull request #454 from LeslieCarr/MODULES-1827-add-cumulus-linux
MODULES-1827 adding Cumulus Linux detection
2015-03-06 12:13:49 +00:00
Leslie Carr
4802a6fc77 MODULES-1827 adding Cumulus Linux detection
the apt module did not correctly detect Cumulus Linux with lsbdistid.
This change adds several lines in params.pp to detect Cumulus Linux and
set $distid and $distcodename
2015-03-05 16:56:03 -08:00
Morgan Haskel
a8250aecfe Merge pull request #452 from puppetlabs/daenney/rename-trusted-source
apt::source: Rename `trusted_source`.
2015-03-05 16:49:23 -08:00
Daniele Sluijters
90bade9561 apt::source: Rename trusted_source.
It is weird that `trusted_source` would default to `false` as that would
imply that we normally don't trust our sources. This is opposite to the
truth, by default we trust them but only if the Releases file can be
verified (meaning it is signed by a GPG key known to apt).

What we were telling apt is that it should trust this source even if the
Releases file and the repository is unsigned. This is better captured
with `allow_unsigned` and better highlights the danger of what you're
doing, installing packages from a source we cannot authenticate.
2015-03-05 20:23:38 +01:00
Morgan Haskel
2a28938299 Merge pull request #451 from puppetlabs/daenney/consolidate-include
apt::source: Merge `include_*` options into hash.
2015-03-05 11:10:20 -08: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
Morgan Haskel
acd280bce9 Merge pull request #450 from puppetlabs/daenney/guard-lsb-facts
apt::params: Complete $xfacts.
2015-03-03 09:38:29 -08:00
Daniele Sluijters
1c707c7d32 apt::params: Complete $xfacts.
`$xfacts` now contains and guards all `lsb*` facts. Looking up any
`lsb*`-related fact should now always be done through `$::apt::xfacts`
to ensure that the values are always set to either the value of the fact
or undef. This avoids all sorts of kerfuffles with strict variables.
2015-03-03 18:07:48 +01:00
Morgan Haskel
001e3a42b9 Merge pull request #449 from puppetlabs/daenney/fix-strict-vars
apt: Fix all strict variable cases.
2015-03-03 08:54:27 -08: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
Morgan Haskel
d05e71238e Merge pull request #448 from puppetlabs/daenney/kill-file-perms
apt::setting: Remove file_perms.
2015-03-02 11:53:53 -08:00
Daniele Sluijters
7a35ea0355 apt::setting: Remove file_perms.
This was a great idea but is pretty pointless. It's also not being used
by anything and not exposed as a switch on the main class so it would
almost never affect any behaviour.
2015-03-02 20:37:01 +01:00
Morgan Haskel
396036892d Merge pull request #447 from puppetlabs/daenney/hulk-smash-2
It's been a long time - how have you been
2015-03-02 10:10:37 -08:00
Daniele Sluijters
0cb48b0c47 apt:🔑 Be explicit about the keyserver.
The behaviour of passing down undef through multiple layers gets fuzzy
so for now be explicit about the keyserver.

Once Puppet 4 is out and this behaviour has been crystallised and tested
we can revisit it.
2015-03-01 14:49:04 +01:00
Daniele Sluijters
061bc49463 apt:🔑 Rename $key to $id to match apt_key. 2015-03-01 14:40:17 +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
Morgan Haskel
aae853b585 Merge pull request #446 from puppetlabs/daenney/apt-proxy
apt: Add proxy support on the class.
2015-02-27 13:09:07 -08: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
Daniele Sluijters
b6c70b70e7 Merge pull request #445 from mhaskel/updates_everywhere
Make apt::setting notify Exec['apt_update'] by default
2015-02-27 09:01:38 +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
a21c183b72 Merge pull request #444 from puppetlabs/daenney/parse-setting-from-name
apt::setting: Parse type and name from title.
2015-02-26 11:27:38 -08:00
Daniele Sluijters
d261d8f11b apt::setting: Parse type and name from title.
Instead of having two additional parameters, `base_name` and
`setting_type` simply parse it from `title`.

We need to prefix most resources with `list-`, `conf-`, or `pref-` any
way to avoid duplicate resources so we might as well leverage that.
2015-02-26 20:15:42 +01:00
Daniele Sluijters
e588ab622b Merge pull request #443 from mhaskel/proxy_updates
proxy_* params were removed from class apt
2015-02-26 18:00:17 +01:00
Daniele Sluijters
a634fe2189 Merge pull request #441 from mhaskel/use_setting
Convert to use apt::setting instead of file resource
2015-02-26 18:00:02 +01: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
3e44b685d2 proxy_* params were removed from class apt
Add them to PPA since they were being used there, and add a placeholder
example for setting up the proxy files.
2015-02-25 09:56:24 -08:00
Daniele Sluijters
1c0c6f106a Merge pull request #442 from mhaskel/add_base_name
Add base_name parameter to apt::setting
2015-02-25 18:22:37 +01:00
Daniele Sluijters
fd71aedda7 Merge pull request #440 from mhaskel/fix_setting_validation
Allow priorities to be zero-padded
2015-02-25 18:22:04 +01:00
Morgan Haskel
1236ecff2c Add base_name parameter to apt::setting
This allows you to work around duplicate resource issues when you have
settings of different types with the same name. When the files are built
it is path/${priority}${base_name}${extension}.
2015-02-25 07:37:16 -08:00
Morgan Haskel
e0f058cc20 Allow priorities to be zero-padded 2015-02-25 07:33:05 -08:00
Daniele Sluijters
d6ac23f777 Merge pull request #439 from mhaskel/rspec3
Convert specs to RSpec 3.1.7 syntax with Transpec
2015-02-25 08:45:30 +01:00
Morgan Haskel
4e453191ea Merge pull request #438 from puppetlabs/daenney/cant-touch-params-nanananana
apt::params: Make the class private.
2015-02-24 16:14:23 -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
Daniele Sluijters
3b5145bf51 apt::params: Make the class private.
Prevent direct access to apt::params. This will ensure that any other
module cannot blindly access apt::params and get settings that have been
potentially overridden at the apt level.

Our own module still can since any class in apt has a module_name of
'apt' but that's up to us to prevent from happening.

Every setting must now be accessed by a qualified lookup into the apt
namespace.
2015-02-24 21:43:36 +01:00
Daniele Sluijters
0e3220711b Merge pull request #437 from fraenki/fix_example
fix hiera example in documentation
2015-02-24 14:48:20 +01:00
Frank Wall
08192b3927 fix hiera example in documentation 2015-02-24 14:38:43 +01:00
Daniele Sluijters
cddf5498f0 Merge pull request #433 from mhaskel/ppa
PPA Cleanup, pt 1
2015-02-23 20:21:10 +01:00
Morgan Haskel
1b6e046bea PPA Cleanup, pt 1
Make the code much cleaner, but don't make a t&p.
2015-02-22 14:44:27 -08:00
Daniele Sluijters
c4981a0739 Merge pull request #432 from mhaskel/source_cleanup
Cleanup for `apt::source`
2015-02-22 00:30:36 +01: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
Daniele Sluijters
7e7e3e2f50 Merge pull request #435 from mhaskel/setting_fix
Type is a reserved word in puppet 4
2015-02-22 00:22:59 +01:00