From bb3a1f0af06febbae96effd048448f03e4c87d7e Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Thu, 19 Feb 2015 15:39:14 -0800 Subject: [PATCH] Remove required packages I'm not entirely clear on the history behind this feature, and this feels sort of hack-y. If you could explain why this is needed that would be awesome, or if it isn't just merge this :) --- manifests/source.pp | 13 ------------- spec/classes/apt_spec.rb | 1 - spec/defines/source_spec.rb | 10 ---------- 3 files changed, 24 deletions(-) diff --git a/manifests/source.pp b/manifests/source.pp index 3e9414f..b06d610 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -9,7 +9,6 @@ define apt::source( $repos = 'main', $include_src = true, $include_deb = true, - $required_packages = false, $key = undef, $key_server = 'keyserver.ubuntu.com', $key_content = undef, @@ -60,18 +59,6 @@ define apt::source( } } - if ($required_packages != false) and ($ensure == 'present') { - exec { "Required packages: '${required_packages}' for ${name}": - command => "${provider} -y install ${required_packages}", - logoutput => 'on_failure', - refreshonly => true, - tries => 3, - try_sleep => 1, - subscribe => File["${name}.list"], - before => Exec['apt_update'], - } - } - # We do not want to remove keys when the source is absent. if $key and ($ensure == 'present') { apt::key { "Add key: ${key} from Apt::Source ${title}": diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 5095904..b92f7dd 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -96,7 +96,6 @@ describe 'apt', :type => :class do 'location' => 'http://debian.mirror.iweb.ca/debian/', 'release' => 'unstable', 'repos' => 'main contrib non-free', - 'required_packages' => 'debian-keyring debian-archive-keyring', 'key' => '55BE302B', 'key_server' => 'subkeys.pgp.net', 'pin' => '-10', diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 684a6f0..7a1cac3 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -51,7 +51,6 @@ describe 'apt::source', :type => :define do 'release' => 'sid', 'repos' => 'testing', 'include_src' => false, - 'required_packages' => 'vim', 'key' => GPG_KEY_ID, 'key_server' => 'pgp.mit.edu', 'key_content' => 'GPG key content', @@ -78,15 +77,6 @@ describe 'apt::source', :type => :define do }) } - it { is_expected.to contain_exec("Required packages: 'vim' for my_source").that_comes_before('Exec[apt_update]').that_subscribes_to('File[my_source.list]').with({ - 'command' => '/usr/bin/apt-get -y install vim', - 'logoutput' => 'on_failure', - 'refreshonly' => true, - 'tries' => '3', - 'try_sleep' => '1', - }) - } - it { is_expected.to contain_apt__key("Add key: #{GPG_KEY_ID} from Apt::Source my_source").that_comes_before('File[my_source.list]').with({ 'ensure' => 'present', 'key' => GPG_KEY_ID, -- 2.45.2