Puppet Function: tlsinfo::keypath

Defined in:
lib/puppet/functions/tlsinfo/keypath.rb
Function type:
Ruby 4.x API

Overview

tlsinfo::keypath(String $cert, Optional[Stdlib::Unixpath] $basepath)Any

Parameters:

  • cert (String)
  • basepath (Optional[Stdlib::Unixpath])

Returns:

  • (Any)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/puppet/functions/tlsinfo/keypath.rb', line 4

Puppet::Functions.create_function(:'tlsinfo::keypath') do
  dispatch :keypath do
    param 'String', :cert
    optional_param 'Stdlib::Unixpath', :basepath
  end

  def keypath(cert, basepath = nil)
    unless basepath
      basepath = closure_scope['tlsinfo::params::keybase']
    end
    base = Puppet_X::TlsInfo.basename(cert)
    "#{basepath}/#{base}.key"
  end
end