Enthusiast
Enthusiast

vRA8.1 change user inputs programatically

Jump to solution

I am trying to change Ansible password via extensibility using the below code via event broker topic deployment.resource.request.pre.

I have Properties as input and variable `customInput` is setup as the output of the workflow of type Properties

var customInput = inputProperties.requestInputs || new Properties();
customInput.ansiblePassword = "VMware1!"

the password is not getting changed this way. any help is appreciated.

The reason being that I save the password in vRO as a securestring and then inject it in there so that I don't have it hardcoded in the blueprint.

Tags (2)
1 Solution

Accepted Solutions
Enthusiast
Enthusiast

One more thing to note is that the subscription will need to be set to blocking if you want to write data back to vRA from your workflow.  That way it vRA knows to wait for it to complete and can accept that output.

Out of curiosity, how/when do you plan on using that password?  Just wondering if this Event is too late?  Meaning, if you're trying to reference this input on your blueprint, does it need to be set before a deployment is submitted?  Not sure if/how well these events and the overall flow is documented by vmware, but from my experience it's all been pretty lacking - lots of trial and error.

Another thought, if needed, may be to create the input on the blueprint, make it hidden on your form and tie it to a vRO action that reads the element and returns the password.

View solution in original post

0 Kudos
4 Replies
Enthusiast
Enthusiast

In general when working with the event broker, I believe the output variable(s) of your workflow needs to be a valid field according to the schema of that topic (which you can see in cloud assembly -> extensibility -> event topics).

In your case, that topic doesn't know of any field called customInput, so I'm guessing your output is effectively being ignored.  Instead, try calling your output variable requestInputs.

0 Kudos
Enthusiast
Enthusiast

tried it but didn't work

0 Kudos
Enthusiast
Enthusiast

One more thing to note is that the subscription will need to be set to blocking if you want to write data back to vRA from your workflow.  That way it vRA knows to wait for it to complete and can accept that output.

Out of curiosity, how/when do you plan on using that password?  Just wondering if this Event is too late?  Meaning, if you're trying to reference this input on your blueprint, does it need to be set before a deployment is submitted?  Not sure if/how well these events and the overall flow is documented by vmware, but from my experience it's all been pretty lacking - lots of trial and error.

Another thought, if needed, may be to create the input on the blueprint, make it hidden on your form and tie it to a vRO action that reads the element and returns the password.

View solution in original post

0 Kudos
Enthusiast
Enthusiast

vRO action worked. thanks for the advise