Ansible Variable


in one of the excerise the inv file is :
db1 ansible_connection=winrm ansible_user=administrator ansible_ssh_pass=Password123!
we need to use ansible_host variable in our playbook. In solution I see the variable is being used as ansible_host, rather that {{ ansible_host }}
Same is in next question’s solution

age is not being used as {{ age }}

May I know how can we differentiate where to use with {{}} and where to use without {{}}


you can use {{}} anywhere, but you will get some warnings conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. So, with condition statement, you should use ‘’, otherwise use {{}}

Understood. Thank You Very Much.


With pleasure! Happy learning