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({