From: Francois Deppierraz Date: Mon, 3 Jun 2013 09:57:58 +0000 (+0000) Subject: Install required_packages before 'apt-get update' X-Git-Tag: 1.2.0~5^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=37a0dcd0b63ab5420420ffe988cce49eb5e01c73;p=puppet-modules%2Fpuppetlabs-apt.git 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. --- diff --git a/manifests/source.pp b/manifests/source.pp index a859174..9a358fe 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -61,6 +61,7 @@ define apt::source( logoutput => 'on_failure', refreshonly => true, subscribe => File["${name}.list"], + before => Exec['apt_update'], } } diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 0f37f63..32aa6c8 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -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({