Merge pull request #22 from haus/unique_required_packages

Allow duplicate required_packages between sources

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
This commit is contained in:
Ryan Coleman 2012-02-24 11:12:39 -08:00
commit fab62e6de7
2 changed files with 7 additions and 4 deletions

View file

@ -36,8 +36,9 @@ define apt::source(
}
if $required_packages != false {
exec { "${apt::params::provider} -y install ${required_packages}":
subscribe => File["${name}.list"],
exec { "Required packages: '${required_packages}' for ${name}":
command => "${apt::params::provider} -y install ${required_packages}",
subscribe => File["${name}.list"],
refreshonly => true,
}
}

View file

@ -94,12 +94,14 @@ describe 'apt::source', :type => :define do
it {
if param_hash[:required_packages]
should contain_exec("/usr/bin/apt-get -y install #{param_hash[:required_packages]}").with({
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
})
else
should_not contain_exec("/usr/bin/apt-get -y install #{param_hash[:required_packages]}").with({
should_not 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
})