使用复制模块复制文件时出现Ansible错误

时间:2016-08-04 17:59:55

标签: ansible ansible-playbook ansible-2.x

我在试用Ansible 2.1.0.0

时不断得到这个
- name: Copy Middleware Installer
   copy: src={{ mw_installer }}
        dest={{ installables_home }}
        owner={{ oracle_user }}
        group={{ oracle_group }}

我正在尝试复制1 GB的mw安装程序。目标系统有16 GB的内存并且还有很多空间..我运行ansible的主站有1 GB的RAM。

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py",line 124, in run
res = self._execute()
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 446, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python2.7/site-packages/ansible/plugins/action/copy.py", line 156, in run source_full = self._loader.get_real_file(source_full)
File "/usr/lib/python2.7/site-packages/ansible/parsing/dataloader.py", line 334, in get_real_file
data = f.read()
MemoryError

fatal: [10.135.239.23]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}

如果我使用同步模块

- name: Copy Middleware Installer
  synchronize: src={{ mw_installer }}
    dest={{ installables_home }}
    set_remote_user=no

要求输入密码

1 个答案:

答案 0 :(得分:0)

data = f.read()建议ansible读取一个文件(检查它是否加密) 您应该考虑使用synchronize模块。