On Friday, 2 March 2018 20.54.15 CET Check Peck wrote:
> 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": []}

You need to transfer the file to the host first.
So that's why I in my example used curl, it will get the file and then send 
them in memory to tar that untar the files and save them to disk.


-- 
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 
https://groups.google.com/d/msgid/ansible-project/1865255.J3vD0yQoil%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to