【发布时间】:2015-08-13 06:51:51
【问题描述】:
我在 host1 上安装了 ansible。 host2 上有文件,我需要通过 ansible 将其复制到 host3 上。我正在使用 RHEL。
我在 host2 上运行了以下 yml,但它卡在了复制文件任务中。
- name: Ensure sshd allows agent forwarding
lineinfile: dest=/etc/ssh/sshd_config
regexp=^#?AllowAgentForwarding
line="AllowAgentForwarding yes"
follow=yes
backup=yes
sudo: yes
register: changed_sshd_config
- name: "RHEL: Restart sshd"
shell: /etc/init.d/sshd restart
sudo: yes
when:
- changed_sshd_config | changed
- name: Copy file from host2 to host3
shell: rsync -r -v -e ssh /root/samplefile.gz root@host3:/root
谁能解释一下这里缺少什么。如果可以,请提供提及正确主机的详细步骤。
【问题讨论】:
-
你能把文件发送到host1,然后从那里发送到host3吗?或者如果文件太大,请将其发送到
AWS S3,然后从 host3 复制?
标签: ansible