I have a variable file in my ansible setup called vars.yml, this file contains many variables in this format:
var1: 'val1'
var2: 'val2'
And it works fine, but I want to create new variables where the value is based on the value of another variable with an if statement - for example there could be:
"{% if var1|string() == 'val1' %} {% set var3 = 'val3' %} {% endif %}"
But this doesn't seem to work.