I want to dynamically set a value to a variable using set_fact, however, it always uses the first value:
- name: Global_vars - get env info
set_fact:
jm_env: “{{lookup(‘env’, ‘Environment’)}}”
l_env: “{% if ‘{{jm_env}}==Develop’ %}d{% elif ‘{{jm_env}}==Staging’%}s{% else %}p{% endif %}”
l_env variable always returns d
I have tried putting quotes in different places, etc with no success.