Skip to content

Commit

Permalink
Merge pull request #328 from tosmi/yumrepo
Browse files Browse the repository at this point in the history
Support configuring a yum proxy server
  • Loading branch information
R. Tyler Croy committed Jun 26, 2015
2 parents dfe245d + 56b977b commit a8c0658
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
# cli_try_sleep = 10 (default)
# Seconds between tries to contact jenkins API
#
# repo_proxy = undef (default)
# If you environment requires a proxy to download packages
#
# proxy_host = undef (default)
# proxy_port = undef (default)
Expand Down Expand Up @@ -153,6 +155,7 @@
$user_hash = {},
$configure_firewall = undef,
$install_java = $jenkins::params::install_java,
$repo_proxy = undef,
$proxy_host = undef,
$proxy_port = undef,
$no_proxy_list = undef,
Expand Down
4 changes: 4 additions & 0 deletions manifests/repo/el.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

$repo_proxy = $::jenkins::repo_proxy

if $::jenkins::lts {
yumrepo {'jenkins':
descr => 'Jenkins',
baseurl => 'http://pkg.jenkins-ci.org/redhat-stable/',
gpgcheck => 1,
gpgkey => 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key',
enabled => 1,
proxy => $repo_proxy
}
}

Expand All @@ -24,6 +27,7 @@
gpgcheck => 1,
gpgkey => 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key',
enabled => 1,
proxy => $repo_proxy
}
}
}
7 changes: 7 additions & 0 deletions spec/classes/jenkins_repo_el_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
context 'repo::el' do
describe 'default' do
it { should contain_yumrepo('jenkins').with_baseurl('http://pkg.jenkins-ci.org/redhat/') }
it { should contain_yumrepo('jenkins').with_proxy(nil) }
end

describe 'lts = true' do
let(:params) { { :lts => true } }
it { should contain_yumrepo('jenkins').with_baseurl('http://pkg.jenkins-ci.org/redhat-stable/') }
it { should contain_yumrepo('jenkins').with_proxy(nil) }
end

describe 'repo_proxy is set' do
let(:params) { { :repo_proxy => 'http://proxy:8080/' }}
it { should contain_yumrepo('jenkins').with_proxy('http://proxy:8080/') }
end
end

Expand Down

0 comments on commit a8c0658

Please sign in to comment.