Puppet Function: jenkins_port

Defined in:
lib/puppet/parser/functions/jenkins_port.rb
Function type:
Ruby 3.x API

Overview

jenkins_port()Any

Return the configurad Jenkins port value (corresponds to /etc/defaults/jenkins -> JENKINS_PORT

Example:

$port = jenkins_port()

Returns:

  • (Any)


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet/parser/functions/jenkins_port.rb', line 3

newfunction(:jenkins_port, type: :rvalue, doc: <<-'ENDHEREDOC') do |_args|
  Return the configurad Jenkins port value
  (corresponds to /etc/defaults/jenkins -> JENKINS_PORT

  Example:

      $port = jenkins_port()
  ENDHEREDOC

  config_hash = lookupvar('::jenkins::config_hash')
  if config_hash && \
     config_hash['HTTP_PORT'] && \
     config_hash['HTTP_PORT']['value']
    return config_hash['HTTP_PORT']['value']
  else
    return lookupvar('::jenkins::params::port')
  end
end