Ask Your Question

How do I change the port jenkins runs on with puppet?

asked 2014-07-21 15:07:13 -0600

spuder gravatar image

If you use the Jenkins puppet module, the server starts by default on port 8080.

How can I change the port number without replacing the entire config file?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-11-05 06:21:48 -0600

rob777 gravatar image

I'm using Port 80 did not work for me. I assume this to be related to ports below 1024 requiring special (/root) permissions on Linux.

These hiera files work for me:


    value: 8085


    "jenkins::config_hash": {
        "HTTP_PORT": {"value": "8085"}
edit flag offensive delete link more

answered 2014-09-22 12:40:50 -0600

rfay gravatar image

If you're using rtyler/jenkins, put this in hiera:

    value: 8888

You can also set JENKINSPORT to -1 and set JENKINSHTTPS_PORT the same way

edit flag offensive delete link more

answered 2014-07-21 15:11:15 -0600

spuder gravatar image

updated 2014-07-21 15:15:33 -0600

Use Augeas to replace a single line in a config file.

For example

class augeasfun {

$jenkins_config_location = $osfamily ? {
  'RedHat' => '/etc/sysconfig/jenkins',
  'Debian' => '/etc/default/jenkins',
  default => fail("Jenkins config directory is not set for os: \'${::osfamily}\'")
$jenkins_port = 80

augeas { 'jenkins port' :
  context => "/files/$jenkins_config_location",
  changes => "set JENKINS_PORT $jenkins_port",
  onlyif  => "match JENKINS_PORT[.='$jenkins_port'] size == 0",    }

include augeasfun

Alternatively use the file_line function in the pupeptlabs standard lib

edit flag offensive delete link more


Better yet, use the `shellvar` provider from

Raphink gravatar imageRaphink ( 2014-07-22 03:26:38 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-07-21 15:07:13 -0600

Seen: 937 times

Last updated: Nov 05 '14