Install required_packages before 'apt-get update'

This is necessary when required_packages contains GPG keys that are used for
authenticating other packages. Tested with package ubuntu-cloud-keyring which
is included in Ubuntu main and used by the Ubuntu Cloud Archive.

I think the same problem applies to other *-keyring packages as well.
This commit is contained in:
Francois Deppierraz 2013-06-03 09:57:58 +00:00
parent 18ee4cc6c9
commit 37a0dcd0b6
2 changed files with 3 additions and 1 deletions

View file

@ -61,6 +61,7 @@ define apt::source(
logoutput => 'on_failure',
refreshonly => true,
subscribe => File["${name}.list"],
before => Exec['apt_update'],
}
}

View file

@ -114,7 +114,8 @@ describe 'apt::source', :type => :define do
should contain_exec("Required packages: '#{param_hash[:required_packages]}' for #{title}").with({
"command" => "/usr/bin/apt-get -y install #{param_hash[:required_packages]}",
"subscribe" => "File[#{title}.list]",
"refreshonly" => true
"refreshonly" => true,
"before" => 'Exec[apt_update]',
})
else
should_not contain_exec("Required packages: '#{param_hash[:required_packages]}' for #{title}").with({