Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

apt::source with required_packages may fail #158

Closed
wants to merge 1 commit into from

5 participants

@spul

If apt::source is called from within a manifest including
required_packages installation of packages may fail if local
package lists are out of date (common issue when using
Vagrant with "old" base boxes).
Have apt::source trigger apt::update BEFORE installation of
required_packages fixes that issue for me, even if I do not
fully understand the complete architecture of that module and
I am not aware of possible problems this commit may introduce.

@spul spul apt::source with required_packages may fail
If apt::source is called from within a manifest including
required_packages installation of packages may fail if local
package lists are out of date (common issue when using
Vagrant with "old" base boxes).
Have apt::source trigger apt::update BEFORE installation of
required_packages fixes that issue for me, even if I do not
fully understand the complete architecture of that module and
I am not aware of possible problems this commit may introduce.
6f9fdad
@spul spul referenced this pull request in garethr/garethr-docker
Merged

Improve ubuntu support #8

@petems petems referenced this pull request from a commit
@petems petems Refactored #158, now updates by default
But if you're on a vagrant box, you can change the behaviour by setting to false
7b11438
@petems
Collaborator

Hi @spul, I've opened a pr to your PR (PRception! silpion#1) because I agree with what's being done here, but it would cause issues for people expecting the default behaviour.

So I've changed it so by default it runs an apt update, but you can specify it to false if you don't want that. People who have the module currently don't have to change, and those who want this new behaviour (me included!) can get it.

Any thoughts?

@apenney

+1, this seems like a better approach.

@rtandy

Interesting issue. I know of few different failure modes:

  • Like @spul said, if the package lists are out of date then installing required_packages can fail.
  • If you add the sources.list entry and then apt-get update without installing required_packages first, the update will fail.
  • If you remove a sources.list entry, apt forgets about its packages immediately, even if you haven't run apt-get update yet. So if you set $purge_sources_list = true, you either have to install required_packages before purging sources.list, or wait until after running apt-get update... which is probably going to fail because the required_packages weren't installed yet.
  • A really exotic case would be an external source requiring a package only available in another one: apt-transport-s3 comes to mind. For this to complete without errors you would have to run apt-get update after configuring the source providing apt-transport-s3 but before configuring the s3:// source, and then again before installing the packages provided by that source. I think some people account for this just by running puppet multiple times and ignoring the early failed runs.

I don't know how far into the complex cases we want to take this. My point is mainly that there are several cases that require apt-get update to happen at different times. Personally I think the most sensible default order is required_packages -> apt::source -> apt::update, and having the option of tweaking that for unusual cases (such as an additional apt-get update run early on). Making the dependencies more granular (even to the extent of running apt-get update more than once) should be possible but would take some thought.

Reasonable? :)

@hunner
Owner

Closing this for now. Feel free to reopen when the issues have been addressed!

@hunner hunner closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 6, 2013
  1. @spul

    apt::source with required_packages may fail

    spul authored
    If apt::source is called from within a manifest including
    required_packages installation of packages may fail if local
    package lists are out of date (common issue when using
    Vagrant with "old" base boxes).
    Have apt::source trigger apt::update BEFORE installation of
    required_packages fixes that issue for me, even if I do not
    fully understand the complete architecture of that module and
    I am not aware of possible problems this commit may introduce.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 1 deletion.
  1. +0 −1  manifests/source.pp
View
1  manifests/source.pp
@@ -62,7 +62,6 @@
logoutput => 'on_failure',
refreshonly => true,
subscribe => File["${name}.list"],
- before => Exec['apt_update'],
}
}
Something went wrong with that request. Please try again.