Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add groovy script to enable random port for JNLP connection #226

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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