manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

Vars passed to AWX as arrays are converted to strings by launch_ansible_job

Open mikebutak opened this issue 5 years ago • 15 comments

In the post-provisioning state I'm calling an AWX template. I'm passing 9 variables to the playbook (with prompt on launch active). The playbook is successfully called, and all of the vars come through. However two of the vars are supposed to be arrays. Instead they come through to AWX as strings: e.g., '["chefclient"]' instead of ["chefclient"].

I have confirmed that these vars are indeed of type array in the post-provisioning method before I pass them to the launch_ansible_job method. Per Peter McGowan this is a limitation of launch_ansible_job. Per Jason Frey a fix of this has been previously explored.

mikebutak avatar Feb 09 '21 16:02 mikebutak

hey, any updates on this?

debemdeboas avatar Dec 23 '22 20:12 debemdeboas

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Mar 27 '23 00:03 miq-bot

This issue has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this issue if this issue is still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Jul 03 '23 00:07 miq-bot

hey, any updates on this?

noor47-pixel avatar Aug 24 '23 13:08 noor47-pixel

@agrare I'm not sure why I self-assigned this, but can you take a look at it?

Fryguy avatar Aug 28 '23 17:08 Fryguy

I'm not sure where the limitation lies. I think I misunderstood the original issue and thought it was the automate-array fix that we put in some time ago, but this sounds different and might be down in Ansible::Runner

Fryguy avatar Aug 28 '23 17:08 Fryguy

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Dec 11 '23 00:12 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Mar 18 '24 00:03 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Jun 24 '24 00:06 miq-bot

@GilbertCherrie Do you think that https://github.com/ManageIQ/manageiq-automation_engine/pull/545 fixes this?

Fryguy avatar Jun 24 '24 14:06 Fryguy

@GilbertCherrie Do you think that ManageIQ/manageiq-automation_engine#545 fixes this?

That pr only fixes this issue for multi select arrays. In the image below the result of the multiselect (test1) is an array but the normal select (test2) is still returned as a string. This issue doesn't specify but I'm assuming since we want array values this is using a multiselect component, in which case this pr should fix this issue. If this issue is referring to single select drop downs then this pr won't fix this issue but I'm not sure if we would want to convert a single select dropdown to an array anyways.

image

GilbertCherrie avatar Jun 24 '24 14:06 GilbertCherrie

The fix for this has been merged. However, the fix was tested on Ansible playbooks. I'm not 100% sure that it will fix this for AWX as well but in theory because they all should use the same automation code it should be working for AWX now as well.

GilbertCherrie avatar Jul 16 '24 16:07 GilbertCherrie