# get\_url ... donlwoading html, nt raw content

**URL:** <https://forum.ansible.com/t/get-url-donlwoading-html-nt-raw-content/38058>\
**Category:** Ansible Project\
**Created:** [June 5, 2023, 10:26am UTC](https://forum.ansible.com/t/get-url-donlwoading-html-nt-raw-content/38058 "2023-06-05T10:26:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [June 5, 2023, 10:26am UTC](https://forum.ansible.com/t/get-url-donlwoading-html-nt-raw-content/38058/1 "2023-06-05T10:26:06Z")

</div>

I want to download a .j2 file from a local bitbucket repository to a local folder.

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [June 5, 2023, 1:36pm UTC](https://forum.ansible.com/t/get-url-donlwoading-html-nt-raw-content/38058/2 "2023-06-05T13:36:46Z")

</div>

> # I want to download a .j2 file from a local bitbucket repository to a local folder.
> 
> - name: download artifacts - fetch template from repo  
> delegate\_to: localhost  
> ansible.builtin.get\_url:  
> url: “[https://devtools/bitbucket/projects/EAKTEMV/repos/infrastruktur/raw/postgres/templates/{{](https://devtools/bitbucket/projects/EAKTEMV/repos/infrastruktur/raw/postgres/templates/%7B%7B) item }}”  
> dest: “…/temp/{{ item }}”  
> loop:
> - create\_user\_db\_schema.sql.j2
> 
> ==============================================================
> 
> - the TASK runs fine
> - there is the raw file under the url
> - a file named ‘create\_user\_db\_schema.sql.j2’ is being downloaded
> 
> contenst of the file is the html of the website rather then the raw .j2 file though.
> 
> What am I doing wrong?

You seem to be fetching the wrong url
