Skip to content

Commit

Permalink
updated suse repo module after rebase/merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aboe76 committed Oct 12, 2013
1 parent f8b3006 commit c130234
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
6 changes: 3 additions & 3 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
before => Anchor['jenkins::repo::omega'],
}
}
'Suse' : {

'Suse' : {
class { 'jenkins::repo::suse':
require => Anchor['jenkins::repo::alpha'],
before => Anchor['jenkins::repo::omega'],
}
}

default: {
fail( "Unsupported OS family: ${::osfamily}" )
Expand Down
14 changes: 6 additions & 8 deletions manifests/repo/suse.pp
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# Class: jenkins::repo::suse
#
class jenkins::repo::suse ( $lts=0 )
class jenkins::repo::suse
{

include 'jenkins::repo'

if $lts == 0 {
if $::jenkins::lts_real {
zypprepo {'jenkins':
descr => 'Jenkins',
baseurl => 'http://pkg.jenkins-ci.org/opensuse/',
baseurl => 'http://pkg.jenkins-ci.org/opensuse-stable/',
gpgcheck => 1,
gpgkey => 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key'
}
}
elsif $lts == 1 {

else {
zypprepo {'jenkins':
descr => 'Jenkins',
baseurl => 'http://pkg.jenkins-ci.org/opensuse-stable/',
baseurl => 'http://pkg.jenkins-ci.org/opensuse/',
gpgcheck => 1,
gpgkey => 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key'
}
}

}
8 changes: 3 additions & 5 deletions spec/classes/jenkins_repo_suse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

describe 'jenkins::repo::suse' do
# Switching OS Family to prevent duplicate declaration
let(:facts) { { :osfamily => 'Debian' } }

it { should include_class('jenkins::repo') }
let(:facts) { { :osfamily => 'Suse' } }

describe 'default' do
it { should contain_zypprepo('jenkins').with_baseurl('http://pkg.jenkins-ci.org/opensuse/') }
end

describe 'lts = 1' do
let(:params) { { :lts => 1 } }
describe 'lts = true' do
let(:pre_condition) { ['class jenkins { $lts_real = true }', 'include jenkins'] }
it { should contain_zypprepo('jenkins').with_baseurl('http://pkg.jenkins-ci.org/opensuse-stable/') }
end

Expand Down

0 comments on commit c130234

Please sign in to comment.