【发布时间】:2018-03-30 19:31:18
【问题描述】:
我是 ansible 的新手,创建了一个可以运行但不执行任何任务的剧本。这是我在一个名为 copy 的角色中的任务,此任务将多个文件从 ansible 服务器复制到远程服务器。
- name: Copy Files
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'audit.rules' , dest: '/etc/audit' }
- { src: 'issue' , dest: '/etc' }
- { src: 'issue.net' , dest: '/etc' }
- { src: 'sshd_config' , dest: '/etc/ssh/' }
- { src: 'hosts' , dest: '/etc' }
- { src: 'rsyslog.conf' , dest: '/etc/' }
- { src: 'sysctl.conf' , dest: '/etc/' }
- { src: 'ntp.conf' , dest: '/etc/' }
这是我的主要剧本
- hosts: all
user: root
roles:
- copy
这是我运行时的输出,但它不会将任何内容复制到目标主机
[root@hq-lxdev1-ansiblem ansible]# ansible-playbook -i hosts playbook.yml
SSH password:
PLAY [all] **********************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
ok: [10.x.x.x]
to retry, use: --limit @/etc/ansible/playbook.retry
PLAY RECAP **********************************************************************************************************************************************************************************************************************************
10.x.x.x : ok=1 changed=0 unreachable=0 failed=0
不知道发生了什么。任何解决此问题的帮助将不胜感激。
【问题讨论】:
标签: ansible