Skip to content

Commit

Permalink
Add groovy script to enable random port for JNLP connection (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonazpiazu authored and nuclearsandwich committed Jan 15, 2020
1 parent f437953 commit 54b2d2b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/profile/files/jenkins/master/enable_tcp_agents.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Enable TCP port for inbound agents */

/* This script is designed to be run via jenkins-cli.jar in order to enable
* connection from agents.
*/

import jenkins.model.Jenkins

def instance=jenkins.model.Jenkins.instance
instance.setSlaveAgentPort(0)
instance.save()
8 changes: 8 additions & 0 deletions modules/profile/manifests/jenkins/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
require => Service['jenkins'],
}

# Enable TCP port for inbound agents
file { '/tmp/enable_tcp_agents.groovy':
source => 'puppet:///modules/profile/jenkins/master/enable_tcp_agents.groovy',
} ->
rosjenkins::groovy { '/tmp/enable_tcp_agents.groovy':
require => Service['jenkins'],
}


# config for audit-trail
file { '/var/lib/jenkins/audit-trail.xml':
Expand Down

0 comments on commit 54b2d2b

Please sign in to comment.