我无法使用ansible复制文件。我甚至没有得到任何错误
测试playbook.yml
---
- name: Test file
hosts: development
tasks:
name: Copying file
copy: src=/home/rajesh.devan/ansible_test/Hello.txt dest=/home/rajesh.devan/ansible_test/HelloWorld.txt
主持人:
[development]
dxxxxcorh516.xxxxx.com ansible_user=rajesh.devan
当我跑步时:
rajesh.devan@dxxxocorh516:~/ansible_test $ ansible-playbook test-playbook.yml --ask-pass
SSH password:
PLAY [Test file] **************************************************************
GATHERING FACTS ***************************************************************
ok: [dxxxxlocorh516.global.xxxxx.com]
PLAY RECAP ********************************************************************
dtxxxxxcorh516.xxxxx.com : ok=1 changed=0 unreachable=0 failed=0
提前致谢!
答案 0 :(得分:0)
请密切关注您的剧本语法
您的输出表明没有名称的任务"正在复制文件"执行。
这是因为,tasks:
应该是一个yaml列表,其中每个新项目都以短划线开头:
---
- name: Test file
hosts: development
tasks:
- name: Copying file
copy: src=/home/rajesh.devan/ansible_test/Hello.txt dest=/home/rajesh.devan/ansible_test/HelloWorld.txt