Puppet Function: mq_install::validate_selection

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

Overview

mq_install::validate_selection(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

Fetch the OS specifc settings and validate if the selected components can be installed here.

rubocop:disable all

Parameters:

  • 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)

    Nothing



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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/puppet/functions/mq_install/validate_selection.rb', line 5

Puppet::Functions.create_function(:"mq_install::validate_selection") do
  # 
  # See the file "LICENSE" for the full license governing this code.
  #
  # @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 Nothing
  #
  dispatch :validate_selection do
    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

  #
  # Validate selection of components based on supported_components values
  #
  def validate_selection( 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)
    kernel = Facter.value(:kernel)
    if install_ams && !supported_components['install_ams']
      call_function('err', "MQ component AMS is not supported on #{kernel}")
      found_error = true
    end
    if install_ft && !supported_components['install_ft']
      call_function('err', "MQ component FT is not supported on #{kernel}")
      found_error = true
    end
    if install_client && !supported_components['install_client']
      call_function('err', "MQ component Client is not supported on #{kernel}")
      found_error = true
    end
    if install_explorer && !supported_components['install_explorer']
      call_function('err', "MQ component Explorer is not supported on #{kernel}")
      found_error = true
    end
    if install_xrserver && !supported_components['install_xrserver']
      call_function('err', "MQ component Xserver is not supported on #{kernel}")
      found_error = true
    end
    if install_samples && !supported_components['install_samples']
      call_function('err', "MQ component Samples is not supported on #{kernel}")
      found_error = true
    end
    if install_sdk && !supported_components['install_sdk']
      call_function('err', "MQ component SDK is not supported on #{kernel}")
      found_error = true
    end
    if install_man && !supported_components['install_man']
      call_function('err', "MQ component man pages is not supported on #{kernel}")
      found_error = true
    end
    if install_gskit && !supported_components['install_gskit']
      call_function('err', "MQ component GSkit is not supported on #{kernel}")
      found_error = true
    end
    if install_amqp && !supported_components['install_amqp']
      call_function('err', "MQ component MQP is not supported on #{kernel}")
      found_error = true
    end
    if install_web && !supported_components['install_web']
      call_function('err', "MQ component Web is not supported on #{kernel}")
      found_error = true
    end
    if install_salesforce && !supported_components['install_salesforce']
      call_function('err', "MQ component Salesforce is not supported on #{kernel}")
      found_error = true
    end
    if install_blockchain && !supported_components['install_blockchain']
      call_function('err', "MQ component Blockchain is not supported on #{kernel}")
      found_error = true
    end
    if install_rdqm && !supported_components['install_rdqm']
      call_function('err', "MQ component RDQM is not supported on #{kernel}")
      found_error = true
    end
    if install_toolkit && !supported_components['install_toolkit']
      call_function('err', "MQ component Development Toolkit is not supported on #{kernel}")
      found_error = true
    end
    call_function('fail', "Listed components are not supported in #{kernel} IBM MQ Version") if found_error
  end
end