Puppet Function: mq_install::selected_components

Defined in:
lib/puppet/functions/mq_install/selected_components.rb
Function type:
Ruby 4.x API

Overview

mq_install::selected_components(String $version, Hash $supported_components, Boolean $install_ams, Boolean $install_ft, Boolean $install_client, Boolean $install_explorer, Boolean $install_xrserver, Boolean $install_samples, Boolean $install_sdk, Boolean $install_man, Boolean $install_gskit, Boolean $install_amqp, Boolean $install_web, Boolean $install_salesforce, Boolean $install_blockchain, Boolean $install_rdqm, Boolean $install_toolkit)Any

Create array of selected components based on the selection.

rubocop:disable all

Parameters:

  • version (String)

    The version of MQ installed

  • supported_components (Hash)

    COmponents supported on this type of system

  • install_ams (Boolean)

    Install component ams

  • install_ft (Boolean)

    Install component ft

  • install_client (Boolean)

    Install component client

  • install_explorer (Boolean)

    Install component explorer

  • install_xrserver (Boolean)

    Install component xrserver

  • install_samples (Boolean)

    Install component samples

  • install_sdk (Boolean)

    Install component sdk

  • install_man (Boolean)

    Install component man

  • install_gskit (Boolean)

    Install component gskit

  • install_amqp (Boolean)

    Install component amqp

  • install_web (Boolean)

    Install component web

  • install_salesforce (Boolean)

    Install component salesforce

  • install_blockchain (Boolean)

    Install component blockchain

  • install_rdqm (Boolean)

    Install component rdqm

  • install_toolkit (Boolean)

    Install component toolkit

Returns:

  • (Any)

    List of selected compinents based on selection



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/puppet/functions/mq_install/selected_components.rb', line 5

Puppet::Functions.create_function(:"mq_install::selected_components") do
  # 
  # See the file "LICENSE" for the full license governing this code.
  #
  # @param version The version of MQ installed
  # @param supported_components COmponents supported on this type of system
  # @param install_ams Install component ams
  # @param install_ft Install component ft
  # @param install_client Install component client
  # @param install_explorer Install component explorer
  # @param install_xrserver Install component xrserver
  # @param install_samples Install component samples
  # @param install_sdk Install component sdk
  # @param install_man Install component man
  # @param install_gskit Install component gskit
  # @param install_amqp Install component amqp
  # @param install_web Install component web
  # @param install_salesforce Install component salesforce
  # @param install_blockchain Install component blockchain
  # @param install_rdqm Install component rdqm
  # @param install_toolkit Install component toolkit
  # @return List of selected compinents based on selection
  #
  dispatch :selected_components do
    required_param 'String',  :version
    required_param 'Hash',    :supported_components
    required_param 'Boolean', :install_ams
    required_param 'Boolean', :install_ft
    required_param 'Boolean', :install_client
    required_param 'Boolean', :install_explorer
    required_param 'Boolean', :install_xrserver
    required_param 'Boolean', :install_samples
    required_param 'Boolean', :install_sdk
    required_param 'Boolean', :install_man
    required_param 'Boolean', :install_gskit
    required_param 'Boolean', :install_amqp
    required_param 'Boolean', :install_web
    required_param 'Boolean', :install_salesforce
    required_param 'Boolean', :install_blockchain
    required_param 'Boolean', :install_rdqm
    required_param 'Boolean', :install_toolkit
    # Because we want to be compatible with Puppet 4.0, we cannot use the
    # return_type yet.
    # TODO: Add this when we lose support for Puppet 4.0
    # return_type 'Array'
  end

  #
  # return full selection of packages
  #
  def selected_components(version, supported_components, install_ams, install_ft, install_client, install_explorer, install_xrserver, install_samples, install_sdk, install_man, install_gskit, install_amqp, install_web, install_salesforce, install_blockchain, install_rdqm, install_toolkit)
    components = supported_components['install_base'] # Always use base
    components << supported_components['install_ams'] if install_ams
    components << supported_components['install_ft'] if install_ft
    components << supported_components['install_client'] if install_client
    components << supported_components['install_explorer'] if install_explorer
    components << supported_components['install_xrserver'] if install_xrserver
    components << supported_components['install_samples'] if install_samples
    components << supported_components['install_sdk'] if install_sdk
    components << supported_components['install_man'] if install_man
    components << supported_components['install_amqp'] if install_amqp
    components << supported_components['install_web'] if install_web
    components << supported_components['install_salesforce'] if install_salesforce
    components << supported_components['install_blockchain'] if install_blockchain
    components << supported_components['install_rdqm'] if install_rdqm
    components << supported_components['install_toolkit'] if install_toolkit
    #
    # With MQ 9.2 gskit is required for the base server
    #
    if Float(version[0..2]) >= 9.2
      components.insert(1,supported_components['install_gskit'])
    else
      components << supported_components['install_gskit'] if install_gskit
    end
    components.flatten
  end
end