# Wouldn't be nice to be able to get\_url + uncompress in a single operation?

**URL:** <https://forum.ansible.com/t/wouldnt-be-nice-to-be-able-to-get-url-uncompress-in-a-single-operation/15980>\
**Category:** Ansible Developer\
**Created:** [August 18, 2014, 2:55pm UTC](https://forum.ansible.com/t/wouldnt-be-nice-to-be-able-to-get-url-uncompress-in-a-single-operation/15980 "2014-08-18T14:55:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filipe\_Felisbino](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@Filipe\_Felisbino](https://forum.ansible.com/u/Filipe_Felisbino)\
**Post date:** [August 18, 2014, 2:55pm UTC](https://forum.ansible.com/t/wouldnt-be-nice-to-be-able-to-get-url-uncompress-in-a-single-operation/15980/1 "2014-08-18T14:55:30Z")

</div>

I think it could make the life of ansible users a little bit easier if we could just have a additional parameter to get\_url specifying if we want to decompress the file after the download is done. Something like:

- name: Download kernel  
get\_url:  
url=“[https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.1.tar.xz](https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.1.tar.xz)”  
dest=“/my/kernel/sources/”  
uncompress=yes

In that case dest should be a directory

---

<div class="post-metadata">

**Author:** ![Jesse\_Keating](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jesse\_Keating](https://forum.ansible.com/u/Jesse_Keating)\
**Post date:** [August 18, 2014, 2:58pm UTC](https://forum.ansible.com/t/wouldnt-be-nice-to-be-able-to-get-url-uncompress-in-a-single-operation/15980/2 "2014-08-18T14:58:38Z")

</div>

\<personal\_opinion\>

Trying to chain multiple actions together like this feels like an Ansible anti-pattern. The option set starts to explode, the documentation gets unwieldy, and the error cases multiply.

Having them as separate tasks makes more sense to me. I only want to do an uncompress if the get\_url resulted in a change. Easier to express that with a register and a conditional, and easier for my playbook readers to follow what’s going on.

\</personal\_opinion\>

-jlk

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 18, 2014, 3:00pm UTC](https://forum.ansible.com/t/wouldnt-be-nice-to-be-able-to-get-url-uncompress-in-a-single-operation/15980/3 "2014-08-18T15:00:42Z")

</div>

I’d concur with Jesse above.

I’d possibly consider letting unarchive take a src=http://, to initiate a download on the remote, but that’s probably more trouble than it’s worth in terms of implications and duplicated efforts.

We definitely want to caution against the permutations building up in all the modules.
