- name: abc
set_fact:
Var1: “TestVarable”
when: “{{‘prod’ in env}}”
I will pass env as prod so it should pick var1 as Testvariable.
Please help on correct syntax
when: “{{‘prod’ in env}}”
I will pass env as prod so it should pick var1 as Testvariable.
Please help on correct syntax
- name: abc
set_fact:
Var1: "TestVarable"
when: "{{'prod' in env}}"I will pass env as prod so it should pick var1 as Testvariable.
Please help on correct syntax
Hello Sridhar,
the when: condition is always evaluated as Jinja, so remove the curly braces:
when: "'prod' in env"
Regards
Racke
Thank you