Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Unarchive module thinks existing dirs are nonexistent #4575

Closed
surfer190 opened this issue Aug 27, 2016 · 3 comments
Closed

Unarchive module thinks existing dirs are nonexistent #4575

surfer190 opened this issue Aug 27, 2016 · 3 comments

Comments

@surfer190
Copy link

This issue was closed and asked to be reopened if it persisted. It has.

#932

ISSUE TYPE
  • Bug Report
COMPONENT NAME

unarchive

ANSIBLE VERSION
ansible 2.1.1.0
  config file = 
  configured module search path = Default w/o overrides
OS / ENVIRONMENT

Local: Mac el capitan
Remote: ubuntu 16.04

SUMMARY

Executing the following task gives:

  - name: Download the filebeat dashboards
    get_url: url="https://download.elastic.co/beats/dashboards/beats-dashboards-1.2.2.zip" dest=/tmp/beats-dashboards-1.2.2.zip mode=0775

  - name: Unzip dashboards
    unarchive: src=/tmp/beats-dashboards-1.2.2.zip dest=/home/{{ user }}

Gives the error:

 TASK [Download the filebeat dashboards] >
 ----------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

ok: [production]
 _________________________ 
< TASK [Unzip dashboards] >
 ------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

fatal: [production]: FAILED! => {"failed": true, "msg": "file or module does not exist: /tmp/beats-dashboards-1.2.2.zip"}
@ansibot
Copy link

ansibot commented Aug 27, 2016

@dagwieers, @pileofrogs, ping. This issue is waiting on your response.
click here for bot help

@dagwieers
Copy link
Contributor

dagwieers commented Aug 27, 2016

I don't see any relation to #932. needs_info

@dagwieers
Copy link
Contributor

The unarchive module by default copies the file from your management system to the target. Which means it is looking for the file /tmp/beats-dashboards-1.2.2.zip on your management server. While the get_url module downloads a file on the target system.

So there are two options:

  • either you download the file on your management server (e.g. connection: local and run_once: yes)
  • or you tell unarchive that the file does not need to be copied (e.g. copy=no) and thus the src is located on the target system

notabug

@ansibot ansibot closed this as completed Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants