How to utilize AWX survey variable as conditional

I am trying to use a survey variable in a conditional but a bit stuck

when: (variable_name == ‘string’) but it doesn’t read my variable

I guess this is a syntax error but I am struggling to find out more info on google in relation to surveys.

Any help would be most appreciated

Thank you

Anyone? :slight_smile:

Please show playbook and show what you are putting in survey

Hey weiye,

thanks again for helping me, I’ve just got it working, it was a syntax error.

I wanted a host to be added to awx when a condition was met from the survey… here is what I did.

env_type is the survey variable

  • name: add tower host

when: ‘(env_type) == [“nonprod”]’

i’ll probably handle this differently in future, but for now this is what I wanted