Question: what is the difference between role task and template in ansible?
Answer: So, roles are an easy way to encapsulate and share Ansible information. You could have a subdir in templates per task, for example. But if you wanted to share that task, you'd have to pick the template as well. ... However, roles do not define on which hosts the role will be run.