Wordpress Ansible未归档文件到目标无法读取

Wordpress Ansible未归档文件到目标无法读取,wordpress,ansible,Wordpress,Ansible,我需要将wordpress文件解压缩到AWS上的远程服务器 我可以将wordpress tar下载到不同的目标文件夹中,但是当我尝试取消归档时,会出现以下错误: fatal:[web1]:失败!=>{“changed”:false,“msg”:“Source'/var/www/wp.tar.gz'不可读”}。 这是我的行动手册的一部分: - name: install wordpress hosts: all become_user: root tasks: - name: down

我需要将wordpress文件解压缩到AWS上的远程服务器

我可以将wordpress tar下载到不同的目标文件夹中,但是当我尝试取消归档时,会出现以下错误:
fatal:[web1]:失败!=>{“changed”:false,“msg”:“Source'/var/www/wp.tar.gz'不可读”}。

这是我的行动手册的一部分:

- 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

如何正确访问此文件?

您需要在
unarchive:
行上使用
remote\u src=yes
,否则它将试图从控制主机读取。

我认为您需要在
unarchive:
行上使用
remote\u src=yes
,否则它将尝试从控制主机读取。@CupcakeProtocol这有效!把它作为回答,我会接受的:)