We are experiencing an issue where a variable is not getting passed to a script within a software component for non-admin or non-privileged users. This issue seemed to be similar to a post I made last week where custom properties were not getting passed to the event broker payload.(Link: Custom Properties not being passed in Event Broker payload? ) However after some additional testing, it appears it's not the same issue as far as I can tell.
We are running vRA 7.6
We need to pass a username from a text field on a custom form and pass to a software component. This software component runs a script located on a provisioned VM. If a non-privileged user (blueprint shared access role, no other roles) provisions a VM, the variable is not passed. If an admin request the same blueprint, the variable is passed.
Here is the setup in detail:
1. We pull in a username from "requested for" then pass it off to an action to strip of the @domain.com. We are left with just a username.
2. We have a software component that defines two properties zone and vraUser. We place those on the custom form (hidden), and bind other fields on the form.
3. These values are passed to a script which are configured:
Install Script -
The $zone variable gets passed for both privileged and non-privileged users.
## Install Script # Set PATH export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/root/bin ### SCRIPT="base_install.sh" curl -o $SCRIPT https://satellite.domain.com/pub/provisioning/$SCRIPT chmod +x $SCRIPT ./$SCRIPT $zone
This is where we are having issues with the $vraUser variable getting passed:
## Configure Script # Set PATH export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/root/bin ### SCRIPT="base_configure.sh" curl -o $SCRIPT https://satellite.domain.com/pub/provisioning/$SCRIPT chmod +x $SCRIPT ./$SCRIPT $vraUser
At the top of the base_configure.sh script we print the value received so we can determine if it's getting passed.
# Set PATH export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/root/bin ### echo "Username is: '$1'"
A few things we have confirmed so far:
- Values of the hidden form elements are populated for all users requesting it, so they should be getting passed to the software component.
- Moving the property to a custom property defined in a property group and using that in the software component still doesn't allow for the value to be passed
- Marking the value as 'show in request' does not pass the value
- The $zone variable passed with no issues, while $vraUser does not, unless you are a privileged user. Both properties are configured the same way and in the same software component.
As always, thank you for taking the time to read this thread. Any input here would be helpful!