Merge pull request #479 from mhaskel/update_anchors

(MODULES-1156, MODULES-769) Update anchors
This commit is contained in:
Daniele Sluijters 2015-03-25 08:30:11 +01:00
commit 6d12a039b7
5 changed files with 28 additions and 17 deletions

View file

@ -133,10 +133,7 @@ class apt(
notify => Exec['apt_update'], notify => Exec['apt_update'],
} }
# Need anchor to provide containment for dependencies. contain 'apt::update'
anchor { 'apt::update':
require => Class['apt::update'],
}
# manage sources if present # manage sources if present
if $sources { if $sources {

View file

@ -60,9 +60,4 @@ define apt::ppa(
notify => Exec['apt_update'], notify => Exec['apt_update'],
} }
} }
# Need anchor to provide containment for dependencies.
anchor { "apt::ppa::${name}":
require => Class['apt::update'],
}
} }

View file

@ -60,10 +60,4 @@ define apt::setting (
source => $source, source => $source,
notify => $_notify, notify => $_notify,
} }
if $notify_update {
anchor { "apt::setting::${name}":
require => Class['apt::update']
}
}
} }

View file

@ -27,10 +27,18 @@ describe 'apt::ppa' do
} }
end end
describe 'apt included, no proxy' do describe 'ppa depending on ppa, MODULES-1156' do
let :pre_condition do let :pre_condition do
'class { "apt": }' 'class { "apt": }'
end end
end
describe 'apt included, no proxy' do
let :pre_condition do
'class { "apt": }
apt::ppa { "ppa:foo2": }
'
end
let :facts do let :facts do
{ {
:lsbdistrelease => '14.04', :lsbdistrelease => '14.04',
@ -42,11 +50,13 @@ describe 'apt::ppa' do
end end
let :params do let :params do
{ {
:options => '', :options => '',
:package_manage => true, :package_manage => true,
:require => 'Apt::Ppa[ppa:foo2]',
} }
end end
let(:title) { 'ppa:foo' } let(:title) { 'ppa:foo' }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_package('software-properties-common') }
it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({ it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
:environment => [], :environment => [],

View file

@ -55,6 +55,21 @@ describe 'apt::setting' do
end end
end end
describe 'settings requiring settings, MODULES-769' do
let(:pre_condition) do
'class { "apt": }
apt::setting { "list-teddybear": content => "foo" }
'
end
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
let(:title) { 'conf-teddybear' }
let(:default_params) { { :content => 'di' } }
let(:params) { default_params.merge({ :require => 'Apt::Setting[list-teddybear]' }) }
it { is_expected.to compile.with_all_deps }
end
describe 'when trying to pull one over' do describe 'when trying to pull one over' do
context 'with source and content' do context 'with source and content' do
let(:params) { default_params.merge({ :source => 'la' }) } let(:params) { default_params.merge({ :source => 'la' }) }