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
"man apt-add-repository" notes: "REPOSITORY can be either a line that
can be added directly to sources.list(5), in the form ppa:<user>/<ppa-name>
for adding Personal Package Archives".
Fix the tests to always use the format ppa:<user>/<ppa-name> when adding
PPAs.
It looks like add-apt-repository changes pluses to underscores when
creating the sources.list.d file. So the name it creates doesn't match
what Puppet expects, and the resource keeps applying on every Puppet
run.
This works around that problem.
The Ruby Tempfile class has a finalizer that removes the file when the
GC runs. It's not predictible when the GC will run, so you have to
ensure that the instance of the class stays in scope for as long as you
need it.
Unfortunately the tempfile method is returning just the filename of the
temporary file, which means it goes out of scope when that method
returns. This allows the GC to reap it at any time after return.
In both CI and production environments we've seen this race fail,
causing apt-key add to fail a small (2-3%) amount of the time.
This changes the tempfile and source_to_file methods to return the
underlying Tempfile object, pushing it up into the caller's scope. Both
of the callers immediately use the object to get its filename and then
open the file, eliminating the race.
Tested this by adding 'GC.start; sleep(1)' immediately before the
command is run, to give the GC plenty of time to remove the tempfile if
it was going to.
The 2.x series added a changed behavior for backport pinning to pin to
origin instead of release. Pinning to release is the correct behavior
for backports though.
* Expose the underlying notify_update setting of the apt::settings resource
This is because not all configuration file changes should trigger an apt::update notification
* apt::pin also shouldn't result in an apt-update call
Adding a pin configuration should apply to the next apt-get update call it shouldn't trigger one itself.
* Added documentation
* Add tests for apt::conf notify_update