Skip to content

Commit

Permalink
create $proxy_server variable in init.pp
Browse files Browse the repository at this point in the history
This variable has the proxy server / port in the format expected by
puppet/archive.
  • Loading branch information
jhoblitt committed Mar 3, 2016
1 parent 77dcd57 commit 755c0c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
7 changes: 4 additions & 3 deletions manifests/direct_download.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
if $::jenkins::version != 'absent' {
# make download optional if we are removing...
archive { $package_file:
source => $jenkins::direct_download,
path => $local_file,
before => Package[$::jenkins::package_name],
source => $jenkins::direct_download,
path => $local_file,
proxy_server => $::jenkins::proxy_server,
before => Package[$::jenkins::package_name],
}
}

Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,14 @@
require => Package['jenkins'],
notify => Service['jenkins']
}

# param format needed by puppet/archive
$proxy_server = "http://${jenkins::proxy_host}:${jenkins::proxy_port}"
} else {
$proxy_server = undef
}


include jenkins::service

if defined('::firewall') {
Expand Down
10 changes: 1 addition & 9 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@
}

if (empty(grep($installed_plugins, $search))) {
if ($jenkins::proxy_host) {
# archive expects protocol in proxy_server, but jenkins proxy.xml expects no protocol
# assume http
$proxy_server = "http://${jenkins::proxy_host}:${jenkins::proxy_port}"
} else {
$proxy_server = undef
}

$enabled_ensure = $enabled ? {
false => present,
default => absent,
Expand Down Expand Up @@ -144,7 +136,7 @@
checksum_verify => $checksum_verify,
checksum => $checksum,
checksum_type => $digest_type,
proxy_server => $proxy_server,
proxy_server => $::jenkins::proxy_server,
notify => Service['jenkins'],
require => File[$::jenkins::plugin_dir],
}
Expand Down
5 changes: 3 additions & 2 deletions manifests/slave.pp
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@

if ($manage_client_jar) {
archive { 'get_swarm_client':
source => "${client_url}/${client_jar}",
path => "${slave_home}/${client_jar}",
source => "${client_url}/${client_jar}",
path => "${slave_home}/${client_jar}",
proxy_server => $::jenkins::proxy_server,
}
}

Expand Down

0 comments on commit 755c0c4

Please # to comment.