Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call apt-get update once per puppet run #13

Closed
wants to merge 1 commit into from
Closed

Only call apt-get update once per puppet run #13

wants to merge 1 commit into from

Conversation

rodjek
Copy link

@rodjek rodjek commented Jan 19, 2012

Change things around so that there's a single Exec[apt update] resource that just gets notified as needed.

https://projects.puppetlabs.com/issues/11966

@bodepd
Copy link

bodepd commented Jan 19, 2012

@rodjek - the code for this looks good at first glance. Could you add some rspec-puppet tests?

@bodepd
Copy link

bodepd commented Jan 19, 2012

the code for this looks good at first glance. Could you add some rspec-puppet tests?

@rodjek
Copy link
Author

rodjek commented Jan 19, 2012

Yep, I'll add them now. Wasn't sure if you were testing with rspec-puppet for this module as the existing tests are kind of sparse.

@bodepd
Copy link

bodepd commented Jan 20, 2012

@rodjek actually @haus is working on the initial set of unit tests. It may make sense to wait until he finishes and then rebase the commit off of his work

@bodepd
Copy link

bodepd commented Feb 8, 2012

@rodjek Just to let you know. We just got those spec tests merged

@bodepd
Copy link

bodepd commented Feb 11, 2012

@rodjek update on this pull request. Having a single apt-update is actually problematic. The problem is that you may have to run an apt-update both before you install python-software properties and after (if you use apt-repository-add)

@tbroyer
Copy link

tbroyer commented Feb 24, 2012

Isn't it worth the trouble anyway?

I mean, having to do an apt-update before installing python-software-properties is kind of an edge-case, right? Compare that with saving a half-dozen apt-update; wouldn't the 80/20 rule apply here?
Also, note that this review doesn't change Apt::Ppa to use Apt::Update, so you should be able to install python-software-properties after an Apt::Update and before an Apt::Ppa (which will use it's own apt-update, for now one for each added PPA).

Also, this is orthogonal to this review, but:

  • python-software-properties should probably only be installed if you use Apt::Ppa (i.e. defined in Apt::Ppa)
  • there should probably be a dependency between Exec['apt update'] and Package<| provider == apt |> to make sure packages are processed after the apt-update has been (possibly) run
  • and of course the apt-update triggered by Apt::Ppa should be consolidated as is done here for Apt, Apt::Source and Apt::Builder (though in another Exec, see above).

exec { "apt-builddep-${name}":
command => "/usr/bin/apt-get -y --force-yes build-dep $name",
notify => Exec["apt-update-${name}"],
notify => Exec["apt update"],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't Apt::Update declare a dependency on this Exec["apt update"] so that this line (and all other similar ones) read notify => Class["Apt::Update"] instead?

@branan
Copy link

branan commented May 4, 2012

This no longer merges cleanly. Reimplemented in #49

@branan branan closed this May 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants