Francesca
Francesca

Reputation: 81

Ansible unarchiving file to destination unreadable

I need to unarchive a wordpress file into a remote server on AWS.

I am able to download the wordpress tar into a different destination folder, however I get this error when I try to unarchive it: fatal: [web1]: FAILED! => {"changed": false, "msg": "Source '/var/www/wp.tar.gz' not readable"}'.

Here is my a portion of my playbook:

- name: install wordpress
  hosts: all 
  become_user: root
tasks:
 - name: download wordpress
   get_url: url=https://wordpress.org/latest.tar.gz dest=/var/www/wp.tar.gz
- name: unarchive wordpress
  unarchive: src=/var/www/wp.tar.gz dest=/var/www/html
- name: template
  template: src=/home/ec2-user/ansible_templates/wp-config.j2 dest=/var/www/html/wordpress/wp-config.php

How do I access this file correctly?

Upvotes: 0

Views: 513

Answers (1)

Cupcake Protocol
Cupcake Protocol

Reputation: 691

You need remote_src=yes on the unarchive: line, otherwise it's trying to read from the controlling host.

Upvotes: 1

Related Questions