From 37a0dcd0b63ab5420420ffe988cce49eb5e01c73 Mon Sep 17 00:00:00 2001 From: Francois Deppierraz Date: Mon, 3 Jun 2013 09:57:58 +0000 Subject: [PATCH] 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. --- manifests/source.pp | 1 + spec/defines/source_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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({ -- 2.45.2