I use service dialogs and catalog_items in MIQ to trigger Job Templates of Ansible Tower.
I would like to customize request_validation by checking the value of some of my inputs from the service dialog. E.G. If a DataCenter being specified during the order of the service is ‘THIS_VALUE’ the operation is allowed, else not.
I found this code snippet in Control auto or manual approval of a service request through validate_request
unless %w(t2.nano t2.micro).include?(dialog_options[‘dialog_InstanceType’])
$evm.log(“info”, “Instance type too big, need a manual approval”)
But somehow I cannot customize it for my usage. My variable is ‘datacenter’ I would rather need something like
if dialog_datacenter not ‘THIS_VALUE’
$evm.log(“info”, “This DC is Not OK” )
$evm.log(“info”, “This DC is OK”)
I 'm not that familiar with Ruby and the internal MIQ Objects. So it would be great if somebody could give me a little hint.
THX in advance and best regards, Marcel.