Ask Your Question
0

update apt::source before package install

asked 2017-01-30 04:10:10 -0600

I'm unable to get a repo to run an "apt-get update" before it evaluates a package. Any tricks? This is what I assumed would work.

apt::source {'foo-repo': location => 'http://my.repo.com' .... }

package {'foo': ensure => latest, require => Apt::Source['foo-repo'] }

apt::source, according to the docs, runs a update notify on each change, which works, but the update is not performed before evaluating package foo. It appears that the source is included first, then the package resource is evaluated, but before the "apt-get update" is run. Any tricks to get this to work, so that it can work on a single run?

edit retag flag offensive close merge delete

Comments

Frankly, I've put _all_ my `apt::source` resources into a stage before `Stage['main']` – not just those which bring a massive amount of packages. https://docs.puppet.com/puppet/latest/lang_run_stages.html

Kai Burghardt gravatar imageKai Burghardt ( 2017-01-30 18:14:10 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-01-30 04:21:20 -0600

I simply made a mistake in my ordering and used the wrong require. This works as expected. The apt-get update will run when the source changes, and the package resource will not be applied until that update is finished.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-01-30 04:10:10 -0600

Seen: 210 times

Last updated: Jan 30