[feat] Don't run an additional apt-get update
When adding custom keys, an additional `apt-get update` would
be run before the Exec['refresh_apt'], which don't make sense.
See merge request !31
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.
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
Removing the require line solves this.
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.
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.
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.
* 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.
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.
See merge request !16
* 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