Wait until after aptitude update and file install before installing package

asked 2014-11-12 11:06:48 -0600

Joseph Carlos gravatar image

There is a package I want to install that can only be installed when an apt preference file is installed and aptitude update is run. Here is what I have so far:

file {'/etc/apt/preferences.d/ubuntu-archive-keyring':
  source => 'puppet:///modules/debuild/etc/apt/preferences.d/ubuntu-archive-keyring',
  mode   => '0644',
  notify => Exec['aptitude_update_debuild'];

package { 'ubuntu-archive-keyring':
  ensure  => installed,
  require => File['/etc/apt/preferences.d/ubuntu-archive-keyring'],

exec { 'aptitude_update_debuild':
  command     => 'aptitude update',
  refreshonly => true,

The problem is it looks as if Puppet is attempting to install the ubuntu-archive-keyring package before aptitude update runs when I need it install after aptitude update:

notice: /Stage[main]/Debuild/File[/etc/apt/preferences.d/ubuntu-archive-keyring]/ensure: defined content as '{md5}3aed97adfc1da135e607db1914d3ab54'
info: /Stage[main]/Debuild/File[/etc/apt/preferences.d/ubuntu-archive-keyring]: Scheduling refresh of Exec[aptitude_update_debuild]
notice: /Stage[main]/Debuild/Package[ubuntu-archive-keyring]/ensure: created
notice: /Stage[main]/Debuild/Exec[aptitude_update_debuild]: Triggered 'refresh' from 1 events
edit retag flag offensive close merge delete