【发布时间】:2016-01-08 22:10:57
【问题描述】:
我正在使用Ansible 并尝试将SSH Key 从我的服务器放到另一个远程服务器。
这是我的代码。
- name: Add RSA key to the remote host
authorized_key:
user:
name:"{{ item.user }}"
key:"{{ lookup('file', '/home/ansible/.ssh/id_rsa.pub') }}"
path:"/home/{{ item.username }}/.ssh/authorized_keys"
when: item.get('state', 'present') == 'present'
with_items: USER_LIST
每次尝试执行时都会出现以下错误。
ERROR: Syntax Error while loading YAML script, /home/ansible/public_html/ansible/roles/user/tasks/main.yml
注意:错误可能实际出现在该位置之前:第 39 行第 5 列
【问题讨论】:
标签: ssh yaml ansible ansible-playbook