Variables requested via survey always overwrite template defaults

Hi there,
I’m running AWX 17.0.1, recently upgraded from 15.x.

Now, suppose you have a template whose default extra_vars are

foo: bar
username: "{{ awx_user_name }}"

Now consider that this template has a survey to read the user’s input to the username variable. The survey doesn’t have a default value, therefore unless the user types in anything, the value returned by the survey will be an empty variable.

It seems that before version 17.x (didn’t test this on 16.x), AWX would preserve the template’s default extra_vars value but now I see that the empty string gets sent instead.

Could this be considered a bug or is it expected behavior?
As a workaround, I’m setting a default of “{{ awx_user_name }}” to that particular survey.

Thanks in advance for any guidance on this.

Best regards,
Kdu

Hey Kdu,

This seems like you’ve found a bug in awx as I would hope that the system would not overwrite a valid string with an empty string. Do you mind filing a but report so that we can investigate further? https://github.com/ansible/awx/issues/new?assignees=&labels=&template=bug_report.md

Hi there,

Not 100% the same context, but I already reported an issue where an optional survey answer not filled was also passing an empty string value down to the job.
https://github.com/ansible/awx/issues/9176#issuecomment-781948806

I guess this may be related though.

Nicolas

I’ve opened https://github.com/ansible/awx/issues/9525 and mentioned Nicolas’ report as well.