9

I'm getting this error while Ansible (1.9.2) is trying to unpack the file.

19:06:38 TASK: [jmeter | unpack jmeter] ************************************************ 
19:06:38 fatal: [jmeter01.veryfast.server.jenkins] => input file not found at /tmp/apache-jmeter-2.13.tgz or /tmp/apache-jmeter-2.13.tgz
19:06:38 
19:06:38 FATAL: all hosts have already failed -- aborting
19:06:38 

I checked on the target server, /tmp/apache-jmeter-2.13.tgz file exists and it has valid permissions (for testing I also gave 777 even though not reqd but still got the above error mesg).

I also checked md5sum of this file (compared it with what's there on the apache jmeter site) -- It matches!

# md5sum apache-jmeter-2.13.tgz|grep 53dc44a6379b7b4a57976936f3a65e03
53dc44a6379b7b4a57976936f3a65e03  apache-jmeter-2.13.tgz

When I'm using tar -xvzf on this file, tar is able to show/extract it's contents in the .tgz file.

What could I be missing? At this point, I'm wondering unarchive method/module in Ansible must have some bug.

My last resort (if I can't get unarchive in Ansible to work) would be to use Command: "tar -xzvf /tmp/....." but I don't want to do that as my first preference.

AKS
  • 16,482
  • 43
  • 166
  • 258
  • can you provide a sample task that is failing. – Vor Sep 21 '15 at 18:42
  • @Vor The task was simple like as per Ansible unarchive example here: http://docs.ansible.com/ansible/unarchive_module.html I missed to use one of the option (copy=no).. my bad i guess. – AKS Sep 21 '15 at 18:52

1 Answers1

18

The default behavior for Unarchive is to find the file on your local system, copy it to the remote, and unpack it. I suspect if you're getting a file not found error then you need to specify copy=no in your task.

valdarin
  • 921
  • 10
  • 20
  • 1
    Extactly.. Just found the same:) By default unarchive will copy the file from the local to the remote. Specify copy: no if the file already exists on the remote. This works with kitchen because kitchen runs in local context. https://github.com/ansible/ansible/issues/8957 – AKS Sep 21 '15 at 18:51
  • Thanks! I was facing the issue using `ansible-container` – mblaettermann Jul 24 '16 at 01:16
  • Wow I was struggling with that behaviour ! That was really unclear for me. Thanks ! – MMacphail May 30 '17 at 19:30