varac [Tue, 26 Jan 2016 14:18:22 +0000 (15:18 +0100)]
[refactor] Get rid of the disable_update parameter
The `disable_update` parameter has been removed. The main apt class
defaults to *not* run an `apt-get update` on every run anyway so
this parameter seems useless.
You can include the `apt::update` class if you want it to be
run every time.
varac [Tue, 26 Jan 2016 13:52:53 +0000 (14:52 +0100)]
[feat] Remove `apt-get autoclean` from apt::update
`apt-get autoclean` should not be run on every puppetrun when
including `apt::update`, but rather be configured as a `APT::Periodic`
task that is run by cron, see
https://wiki.debian.org/UnattendedUpgrades.
varac [Tue, 26 Jan 2016 13:42:17 +0000 (14:42 +0100)]
[refactor] Unify `apt-get update` into one resource
Before, there were two Execs that did an `apt-get update`,
`Exec[refresh_apt]` and `Exec[apt_updated]`, which were triggered
by different resources.
This changes gets rid of the first one, and all resources now depend
on `Exec[apt_updated]`.
varac [Tue, 5 Jan 2016 10:39:57 +0000 (11:39 +0100)]
[bug] Deploy preferene snippets before apt_refresh
When pinning packages with apt::preferences_snippet,
we need to make sure these get deployed before an
`apt-get update` is triggered, so pinned packages can
get installed in the right way with a single puppetrun.
varac [Mon, 7 Dec 2015 15:51:20 +0000 (16:51 +0100)]
[bug] Fix debian_nextcodename on wheezy hosts
I noticed this behaviour because $::debian_nextcodename was
"squeeze" on a wheezy host.
For debugging, i inserted a "puts codenames" in
lib/facter/debian_nextcodename.rb, and it turned out that it
was sorted differently on wheezy and jessie hosts:
On wheezy:
buster
stretch
jessie
wheezy
squeeze
lenny
On jessie:
lenny
squeeze
wheezy
jessie
stretch
buster
So i decided to rewrite this so this doesn't happen again.
varac [Mon, 7 Dec 2015 13:27:04 +0000 (14:27 +0100)]
Fix loading of util/debian.rb for custom facts
requirering the facter/util/debian.rb module causes
puppet warnings on wheezy hosts, and custom facts like
`$::debian_codename` cannot be evaluated.
warning: Could not load fact file
/srv/dev/projects/puppet/shared-modules//apt/lib/facter/debian_nextcodename.rb:
no such file to load -- facter/util/debian
Gabriel Filion [Fri, 4 Dec 2015 19:29:36 +0000 (14:29 -0500)]
remove requirement on lsb package for sources.list file
Managing requirements for installing the lsb package has proven over
time to make no sense. The best approach to this is to require
lsb-release to be installed alongside puppet, since otherwise there are
so much facts that get no value during the run and you end up needing to
run puppet twice to get the real end result.
Also, since we're not including a class that is actually installing the
'lsb' package, that require line makes it so that including the apt
module doesn't work, and there's no documentation in the README about
needing to provide a package{'lsb':} resource with the apt class.
Because of all that, it makes more sense to just get rid of that require
line and mark lsb as a pre-requirement in the README file.
Gabriel Filion [Fri, 4 Dec 2015 17:33:35 +0000 (12:33 -0500)]
Use $ubuntu_url as default value of $backports_url on Ubuntu
Ubuntu shouldn't be using debian backports by default.
This was written by Anoine Beaupré, but split from the commit "move
backports to snippets" since the change is unrelated and needs to be
more visible in the commit history.
Gabriel Filion [Fri, 9 Oct 2015 20:59:33 +0000 (16:59 -0400)]
Make it possible to specify own template.
Micah found an issue with usage of config_content: if you call template('...')
yourself and pass that on to config_content, then your template gets evaluated
without all of the variables. This means that you don't hava access to
blacklisted_packages, mail_recipient or mailonlyonerror.
To make it possible to use a different template while still having access to
those variables, let's make it possible to change the template name that we're
using.
Jerome Charaoui [Fri, 9 Oct 2015 20:39:19 +0000 (16:39 -0400)]
Improve unattended-upgrades origin selectors
* On squeeze, use release fact instead of hardcoded release name
* On wheezy, special-case because codename selector is not available
* On jessie and up, start pulling in point-release updates. The
codename selector ensures that we won't be upgrading to a new
release automatically.
Jerome Charaoui [Tue, 9 Jun 2015 15:49:02 +0000 (15:49 +0000)]
Merge branch 'volatile-backports' into 'master'
allow disabling backports (and volatile in ubuntu)
as the module stands now, there's no way to disable backports.
there are a few reasons why we want to allow this:
* "tools, not policy" - if Debian doesn't ship with backports enabled by default, why should we change that policy?
* too many sources.list entries can cause problems on `apt-get update`, which can run out of memory and require special config
* if the pinning fails, some packages may be updated by mistake
* even if pinning works, some may *want* to keep admins from installing anything from backports as a policy
this keeps backports installed by default (begrudgingly) however. it just allows disabling it.
it also allows disabling volatile in ubuntu, which wasn't possible before.
Jerome Charaoui [Mon, 11 May 2015 14:49:27 +0000 (10:49 -0400)]
Replace debian_*() parser functions with facts
* Removes dependency on lsb-release and/or Facter >1.7
(values are based on $::lsbdistcodename, when available)
* Simplifies maintenance: only lib/facter/util/* require updates as new
releases are made
Caveats:
* apt::codename is removed; to override debian_* facts, set the
FACTER_debian_codename environment variable for puppet
* If tracking unstable, make sure lsb-release is installed, as other
methods can't tell between testing and unstable
There have been some recent changes in debian resulting in changes to sources
* jessie was released and very soon there will be a jessie-backports, so the backports logic needs to handle that
* the http.debian.net redirector has a new official url
Gabriel Filion [Fri, 17 Apr 2015 20:43:26 +0000 (16:43 -0400)]
Add parameter for blacklisting a list of packages.
This functionality was lost because we stopped using a source file for
the 50unattended-upgrades file that would previously let one override
the configuration per release or per host.
Micah [Sat, 28 Feb 2015 16:07:45 +0000 (16:07 +0000)]
Merge branch 'fix-usage-of-module_dir' into 'master'
Fix usage of module_dir
I didn't test enough functionality before merging https://gitlab.com/shared-puppet-modules-group/apt/merge_requests/4 apparently: anything that depends on module_dir is currently broken. Sorry!
Guillaume Marde [Sat, 6 Dec 2014 21:03:21 +0000 (16:03 -0500)]
Added a license. That's a bit cocky, but we're just licensing this stuff as GPLv3, which is part of the basis of unity of most organizations involved in the creation of those. If you absolutely wanna pull out of this shit let us know, we'll try to figure something out ; most likely we'll stop using your part and rewrite them on our own (but better :D).
Gabriel Filion [Sat, 6 Dec 2014 02:29:09 +0000 (21:29 -0500)]
flip around security support for debian
with the release of squeeze-lts, the current way we deal with security
sources is problemaic. by flipping things around we hope to make the
files contents more stable.