Puppet Function: mq_install::selected_components
- Defined in:
- lib/puppet/functions/mq_install/selected_components.rb
- Function type:
- Ruby 4.x API
Overview
Create array of selected components based on the selection.
rubocop:disable all
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 |