Merge pull request #58 from nanliu/tb/ppa
Fix dependency issues introduced with anchor.
This commit is contained in:
commit
a2422f7f7b
4 changed files with 7 additions and 18 deletions
|
@ -3,8 +3,6 @@
|
|||
define apt::builddep() {
|
||||
include apt::update
|
||||
|
||||
Class['apt'] -> Apt::Builddep[$name]
|
||||
|
||||
exec { "apt-builddep-${name}":
|
||||
command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
|
||||
notify => Exec['apt_update'],
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
define apt::ppa(
|
||||
$release = $::lsbdistcodename
|
||||
) {
|
||||
|
||||
Class['apt'] -> Apt::Ppa[$title]
|
||||
|
||||
include apt::params
|
||||
include apt::update
|
||||
|
||||
|
@ -26,7 +23,8 @@ define apt::ppa(
|
|||
exec { "add-apt-repository-${name}":
|
||||
command => "/usr/bin/add-apt-repository ${name}",
|
||||
creates => "${sources_list_d}/${sources_list_d_filename}",
|
||||
require => Package['python-software-properties'],
|
||||
require => [ File[$sources_list_d],
|
||||
Package['python-software-properties'] ],
|
||||
notify => Exec['apt_update'],
|
||||
}
|
||||
|
||||
|
|
|
@ -3,22 +3,15 @@ describe 'apt::builddep', :type => :define do
|
|||
|
||||
let(:title) { 'my_package' }
|
||||
|
||||
describe "should succeed with a Class['apt']" do
|
||||
let(:pre_condition) { 'class {"apt": } ' }
|
||||
|
||||
describe "should require apt-get update" do
|
||||
it { should contain_exec("apt_update").with({
|
||||
'command' => "/usr/bin/apt-get update",
|
||||
'refreshonly' => true
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
describe "should fail without Class['apt']" do
|
||||
it { expect {should contain_exec("apt-update-#{title}").with({
|
||||
'command' => "/usr/bin/apt-get update",
|
||||
'refreshonly' => true
|
||||
}).to raise_error(Puppet::Error)
|
||||
}
|
||||
it { should contain_anchor("apt::builddep::my_package").with({
|
||||
'require' => 'Class[Apt::Update]',
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ describe 'apt::ppa', :type => :define do
|
|||
it { should contain_exec("add-apt-repository-#{t}").with(
|
||||
'command' => "/usr/bin/add-apt-repository #{t}",
|
||||
'creates' => "/etc/apt/sources.list.d/#{filename}",
|
||||
'require' => "Package[python-software-properties]",
|
||||
'require' => ["File[/etc/apt/sources.list.d]", "Package[python-software-properties]"],
|
||||
'notify' => "Exec[apt_update]"
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue