【发布时间】:2019-12-15 03:11:29
【问题描述】:
我正在尝试使用 ansible 复制许多文件。 这是我的剧本:
- name: Copy the scenario test
copy:
src: files/{{ scenario_name }}
dest: /home/{{ user }}/scenario_creation
mode: '0644'
run_once: true
loop: "{{ scenario_name }}"
tags:
- user
- scenario
这是我的角色/scenario_test/defaults/main.yml
scenario_name: ['topup-scenario.json', 'test.json']
当我执行我的剧本时,它说:
"msg": "Could not find or access 'files/[u'topup-scenario.json', u'test.json']'\nSearched in:\n\t/home/path/ansible/plays/files/[u'topup-scenario.json', u'test.json']\n\t/home/path/ansible/plays/files/[u'topup-scenario.json', u'test.json'] on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"
}
有什么帮助吗?
【问题讨论】:
标签: ansible