Ansible

If the value of certain variable is 1, you would like to use the value "one", otherwise, use "two". How would you do it?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

{{ (certain_variable == 1) | ternary("one", "two") }}