diff --git a/modules/profile/files/jenkins/master/enable_tcp_agents.groovy b/modules/profile/files/jenkins/master/enable_tcp_agents.groovy new file mode 100644 index 00000000..9935d054 --- /dev/null +++ b/modules/profile/files/jenkins/master/enable_tcp_agents.groovy @@ -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() diff --git a/modules/profile/manifests/jenkins/master.pp b/modules/profile/manifests/jenkins/master.pp index 612c2cb2..970a5ad4 100644 --- a/modules/profile/manifests/jenkins/master.pp +++ b/modules/profile/manifests/jenkins/master.pp @@ -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':