kharandziuk
kharandziuk

Reputation: 12890

Ansible unarchive: doesn't reach a remote host

I use Ansible as a provisioner for Vagrant. I have a task:

- name: download and unarchive redis binaries
  unarchive:
    src: "http://download.redis.io/redis-stable.tar.gz"
    dest: "/tmp"
    remote_src: True

but for some reasons I see an error in console when I run a vagrant provision:

"failed": true, "msg": "file or module does not exist: /Users/my-username/Projects/project-name/http:/download.redis.io/redis-stable.tar.gz"`

> ansible --version
ansible 2.1.2.0

Any ideas?

NB: look carefully for the error http:/download. Why is there only one backslash?

Upvotes: 2

Views: 326

Answers (1)

techraf
techraf

Reputation: 68459

The syntax from your question works with Ansible 2.2.0.0 and later.

For Ansible 2.0 and 2.1 use:

- name: download and unarchive redis binaries
  unarchive:
    src: "http://download.redis.io/redis-stable.tar.gz"
    dest: "/tmp"
    copy: false

The double slash from your question was stripped, because the argument src was treated as a path to a local file (again, because old versions of Ansible required copy: false in addition to the URL).

Upvotes: 1

Related Questions