You can also use this ansible oneliner command to generate the template without adding code in your playbooks or role file:
ansible -m template -a "src=~/workspace/ansible_templates/somefile_template.j2 dest=/etc/somefile/apps-available/someproject.ini" localhost