# download ISO from artifactory to F5

**URL:** <https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477>\
**Category:** Ansible Project\
**Created:** [July 8, 2021, 1:48pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477 "2021-07-08T13:48:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon\_Day](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Sharon\_Day](https://forum.ansible.com/u/Sharon_Day)\
**Post date:** [July 8, 2021, 1:48pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477/1 "2021-07-08T13:48:00Z")

</div>

I’m working on a playbook to upgrade all our F5 devices but having trouble with the download of the ISO from Artifactory to the F5. When I run the play the file is downloaded but its downloaded to the Ansible control node not the F5. Here’s my play,

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [July 8, 2021, 1:56pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477/2 "2021-07-08T13:56:19Z")

</div>

> I'm working on a playbook to upgrade all our F5 devices but having trouble with the download of the ISO from Artifactory to the F5. When I run the play the file is downloaded but its downloaded to the Ansible control node not the F5. Here's my play,
> 
> ---  
> - hosts:  
> - lab\_f5  
> gather\_facts: no  
> connection: local  
> vars\_prompt:  
> - name: f5\_user  
> prompt: "Enter F5 Username"  
> private: no  
> - name: f5\_password  
> prompt: "Enter F5 Password"
> 
> tasks:
> 
> - name: Shell download  
> shell: curl -vvvv -H 'X-JFrog-Art-API:api\_key' -O [https://artifactory.com/repo/F5/BIGIP-14.1.4.3-0.0.8.iso](https://artifactory.com/repo/F5/BIGIP-14.1.4.3-0.0.8.iso)  
> args:  
> executable: /bin/bash  
> chdir: /shared/images  
> delegate\_to: "{{ inventory\_hostname }}"
> 
> It doesn't seem to matter if I use the delegate\_to statement or not. If I run the play I get a message that the /shared/images doesn't exists and if I remove the chdir or change the directory to something that exists on my Ansible control node it works but downloads the file to the control node not the F5.

You are using "connection: local" for lab\_f5 host, so I think that inventory\_hostname points to the Ansible controller.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 8, 2021, 1:56pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477/3 "2021-07-08T13:56:32Z")

</div>

Why use curl and not the dedicated get\_url module?  
[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/get\_url\_module.html](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/get_url_module.html)

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [July 8, 2021, 2:05pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477/4 "2021-07-08T14:05:32Z")

</div>

> Why use curl and not the dedicated get\_url module?  
> [https://docs.ansible.com/ansible/latest/collections/ansible/builtin/get\_url\_module.html](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/get_url_module.html)

Are you sure that F5 has a proper Python installed?

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Sharon\_Day](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Sharon\_Day](https://forum.ansible.com/u/Sharon_Day)\
**Post date:** [July 8, 2021, 3:26pm UTC](https://forum.ansible.com/t/download-iso-from-artifactory-to-f5/35477/5 "2021-07-08T15:26:03Z")

</div>

This appears to work. I did try the get\_url module and got the same results the file was being downloaded to the Ansible control node. This issue I think with that was the connection: local. I could have tried it with the connection: ssh but I would have needed to make this part of the upgrade be its own playbook. Instead I did this and its working,

- name: Download ISO from Artifactory  
uri:  
method: “POST”  
url: “https://{{ ansible\_host | default(inventory\_hostname) }}/mgmt/tm/util/bash”  
user: “{{ lookup(‘env’, ‘F5\_USER’) }}”  
password: “{{ lookup(‘env’, ‘F5\_PASSWORD’) }}”  
body:  
command: “run”  
utilCmdArgs: “-c ‘cd /shared/images; curl -vvvv -H ‘X-JFrog-Art-API:api\_key’ -O [https://artifactory.com/repo/F5/BIGIP-14.1.4.3-0.0.8.iso](https://artifactory.com/repo/F5/BIGIP-14.1.4.3-0.0.8.iso)’”  
body\_format: json  
status\_code: 200  
validate\_certs: no  
timeout: 120  
register: artifactory\_download
