ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

Return `extravars` & `credentials` as a JSON object not a JSON string #171

Closed dsha256 closed 4 months ago

dsha256 commented 4 months ago

Currently extravars & credentials are returned as a JSON string. Returning them as JSON objects would be great.

Currently:

"extravars": "{\"name\":\"vm1\",\"region\":\"myregion\",\"opco\":\"myopco\"}"

After:

{
  "name": "vm1",
  "opco": "myopco",
  "region": "myregion"
}
ansibleguy76 commented 4 months ago

Hi, I'm not entirely sure what you mean. The goals of AF is to send extravars to either AWX or local ansible. They are sent in the correct format. It's the receiving end that needs to parse the json. But maybe I understand your question wrong.

dsha256 commented 4 months ago

I mean the the formats of the values (extravars & credentials) in the response body given in the screenshot. IDK, maybe that was meant to be shown like it is now for some reason. image

ansibleguy76 commented 4 months ago

aha.. I understand. I could indeed make that an object. I just hope that won't break for others then. Same for credentials then.

ansibleguy76 commented 4 months ago

will be fixed in 5.0.2 (beta coming today). changed together with credentials, approvals, substeps, notifications. All now converted in objects in the api call. The client code is changed too where it is now no longer parsed.

ansibleguy76 commented 4 months ago

new beta is now being pushed. use image ":beta" instead of ":latest". And use ctrl-F5 to clear the browser cache. let me know the outcome

ansibleguy76 commented 4 months ago

I will close this... ping me if you think it should not be closed