Puppet Function: mq_install::validate_selection
- Defined in:
- lib/puppet/functions/mq_install/validate_selection.rb
- Function type:
- Ruby 4.x API
Overview
Fetch the OS specifc settings and validate if the selected components can be installed here.
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 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 |