Ok got it. But if I try this way by using shell module:

> - hosts: TEST_BOX
>   serial: 1
>   tasks:
>       - name: copy and untar latest deals.tar.gz file
>         shell: "cd /data/tasks/files/; tar -xvzf test.tar.gz"

It doesn't work and I get an error like this: Am I doing anything wrong 
with my above tasks?

fatal: [machine_abc]: FAILED! => {"changed": true, "cmd": "cd 
> /data/tasks/files/; tar -xvzf test.tar.gz", "delta": "0:00:00.022610", 
> "end": "2018-03-02 12:47:56.840245", "msg": "non-zero return code", "rc": 
> 2, "start": "2018-03-02 12:47:56.817635", "stderr": "tar (child): 
> test.tar.gz: Cannot open: No such file or directory\ntar (child): Error is 
> not recoverable: exiting now\ntar: Child returned status 2\ntar: Error is 
> not recoverable: exiting now", "stderr_lines": ["tar (child): test.tar.gz: 
> Cannot open: No such file or directory", "tar (child): Error is not 
> recoverable: exiting now", "tar: Child returned status 2", "tar: Error is 
> not recoverable: exiting now"], "stdout": "", "stdout_lines": []}

On Friday, March 2, 2018 at 10:18:40 AM UTC-8, Kai Stian Olstad wrote:
> On Friday, 2 March 2018 19.01.12 CET Check Peck wrote: 
> > Is there any way to avoid copying? Can we not just untar over the wire 
> if 
> > there is any way? 
> Not with unarchive. 
> If you put the file on a web server you could do this 
> - shell: curl -s https://some.url/test.tar.gz | tar xzC /dest 
> But this solution is not idempotent 
> -- 
> Kai Stian Olstad 

You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to