I try to find if a variable has a valid value which is stored in a list.
The name of the list is also stored in a variable. If the variable is not valid the test should fail.
This works if I use the name of the list:
- fail: msg="unsupported version requested"
when: requestedversion not in windowsversionlist
But the name of the versionlist is also a variable because there are more lists like linux and windows.
This does not work:
- fail: msg="unsupported version requested"
when: requesterversion not in versionlist
The value of the variable versionlist is windowsversionlist
I try {{ versionlist }}, etc. but this does not work.