Skip to content

Commit

Permalink
Expire yum cache. Closes #76.
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Jul 21, 2016
1 parent 3693b28 commit b26d554
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
}
case $osrel {
'6', '7': {
exec { 'yum-clean-expire-cache':
user => 'root',
path => '/usr/bin',
refreshonly => true,
command => 'yum clean expire-cache',
} ->
package { 'mesosphere-el-repo':
ensure => present,
provider => 'rpm',
Expand Down
9 changes: 7 additions & 2 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,22 @@
:lsbdistid => operatingsystem,
}}

it { should contain_package('mesosphere-el-repo').with({
it { is_expected.to contain_package('mesosphere-el-repo').with({
'ensure' => 'present',
'provider' => 'rpm',
'source' => "http://repos.mesosphere.io/el/#{osrel}/noarch/RPMS/mesosphere-el-repo-#{osrel}-#{mrel}.noarch.rpm",
})}

it do is_expected.to contain_exec('yum-clean-expire-cache').with({
:command => 'yum clean expire-cache',
})
end

context "undef source" do
let(:params) {{
:source => 'undef',
}}
it { should_not contain_package('mesosphere-el-repo') }
it { is_expected.not_to contain_package('mesosphere-el-repo') }
end
end

Expand Down

0 comments on commit b26d554

Please # to comment.