I would jinja2 template to copy some contents in a file depending on the distribution_major_version. So i am using if statement to achieve the goal. I have this file /mytemplates/foo.j2
Could you please confirm if this is the best practice to write the conditional statement or not?
{% if ansible_facts['distribution_major_version'] == "6" %}
line1
line2
line3
{% elif ansible_facts['distribution_major_version'] == "7" or ansible_facts['distribution_major_version'] == "8"%}
line1
line4
line6
{% endif %}