Hi,

I'm running into the common issue of having to force an "apt-get update" 
before installing packages (in my case - because the base EC2 AMI is old 
and I need it to pick newer package versions).

I ended up doing the usual:

 exec { 'apt-get update':
   path => '/usr/bin/',
 }
 ->
 Package <| |>

(I can't use "apt::update" because it creates dependency cycles) and it 
works.

But what baffles me is that I really only need "apt-get update" to execute 
before "apt" packages get installed, like this:

Package <| provider = "apt" |>

But this doesn't trigger the "apt-get update".

Just as an example, I also have a Gem-provider related exec which works as 
expected:

  exec { 'Add Ruby Gems repo mirror':
    command => 'gem source --config-file /etc/gemrc -a 
http://production.cf.rubygems.org/',
    unless  => 'gem source --config-file /etc/gemrc | fgrep -xq 
http://production.cf.rubygems.org/',
    path    => '/usr/bin:/bin',
  }
  ->
  Package<| provider == 'gem' |>

So why doesn't it work for the "apt" provider?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/786ae86e-9ea6-4bd4-a975-e1113740a275%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to