Puppet Function: classification::split_hostname

Defined in:
lib/puppet/functions/classification/split_hostname.rb
Function type:
Ruby 4.x API

Summary

Split a hostname into its consituent parts.

Overview

classification::split_hostname(String $hostname_string)Array

Split a hostname into its consituent parts

Examples:

[ $group, $function, $number_string, $context, $stage, $id ]

Parameters:

  • hostname_string (String)

    A hostname to parse

Returns:

  • (Array)

    Returns a 6 element array. Some or all the elements may be nil.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/puppet/functions/classification/split_hostname.rb', line 7

Puppet::Functions.create_function(:'classification::split_hostname') do
  # @summary Split a hostname into its consituent parts.
  #
  # Split a hostname into its consituent parts.
  #
  # @param hostname_string A hostname to parse
  # @return Returns a 6 element array. Some or all the elements may be nil.
  # @example
  #   [ $group, $function, $number_string, $context, $stage, $id ]
  dispatch :split_hostname do
    param 'String', :hostname_string
    return_type 'Array'
  end

  def split_hostname(hostname_string)
    Ploperations::Classification.split_hostname(hostname_string)
  end
end