Skip to content

Commit

Permalink
Add tunnel flag for slaves
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesForsee authored and jhooyberghs committed Feb 7, 2018
1 parent 0ee68cb commit e36e33b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/slave.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
# [*executors*]
# Number of executors for this slave. (How many jenkins jobs can run simultaneously on this host.)
#
# [*tunnel*]
# Connect to the specified host and port, instead of connecting directly to Jenkins. Useful when connection to
# Hudson needs to be tunneled. Can be also HOST: or :PORT, in which case the missing portion will be
# auto-configured like the default behavior
#
# [*manage_slave_user*]
# Should the class add a user to run the slave code? 1 is currently true
# TODO: should be updated to use boolean.
Expand Down Expand Up @@ -116,6 +121,7 @@
Optional[String] $tool_locations = undef,
Optional[String] $source = undef,
Optional[String] $proxy_server = undef,
Optional[String] $tunnel = undef,
String $version = $jenkins::params::swarm_version,
Integer $executors = 2,
Boolean $manage_slave_user = true,
Expand Down
2 changes: 2 additions & 0 deletions templates/jenkins-slave-defaults.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ FSROOT="<%= @slave_home -%>"

DESCRIPTION="<%= @description -%>"

TUNNEL="<%= @tunnel -%>"

# credentials should be sinjle quoted
JENKINS_USERNAME=<%= @quoted_ui_user %>
JENKINS_PASSWORD=<%= @quoted_ui_pass %>
Expand Down
3 changes: 3 additions & 0 deletions templates/jenkins-slave-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ SLAVE_ARGS+=(-jar "$JENKINS_SLAVE_JAR")
[[ -n "$DESCRIPTION" ]] &&
SLAVE_ARGS+=(-description "$DESCRIPTION")

[[ -n "$TUNNEL" ]] &&
SLAVE_ARGS+=(-tunnel "$TUNNEL")

[[ -n "$AUTO_DISCOVERY_ADDRESS" ]] &&
SLAVE_ARGS+=(-autoDiscoveryAddress "$AUTO_DISCOVERY_ADDRESS")

Expand Down
1 change: 1 addition & 0 deletions templates/jenkins-slave.Debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export_sysconfig() {
CLIENT_NAME
FSROOT
DESCRIPTION
TUNNEL
JENKINS_USERNAME
JENKINS_PASSWORD
OTHER_ARGS
Expand Down
1 change: 1 addition & 0 deletions templates/jenkins-slave.RedHat.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export_sysconfig() {
CLIENT_NAME
FSROOT
DESCRIPTION
TUNNEL
JENKINS_USERNAME
JENKINS_PASSWORD
OTHER_ARGS
Expand Down

0 comments on commit e36e33b

Please sign in to comment.