Bug in copy module (ansible 1.3.2)

I appear to have come across a bug in the copy module in ansible 1.3.2. The following task in one of my playbooks fails:

  • name: cron job to clean up raw files
    copy: src=clean_up_rawfiles dest=/etc/cron.daily owner=root group=root mode=555

This fails with:

fatal: [rrc15.ripe.net] => Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 382, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 471, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 654, in _executor_internal_inner
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/action_plugins/copy.py”, line 173, in run
module_args.pop(‘raw’)
AttributeError: ‘str’ object has no attribute ‘pop’

I don’t know what the problem is, but I am certain that the presence of the word “raw” in the module arguments is causing this issue. If I change the name of the file to something else NOT containing the word “raw”, it works just fine. Of course, I can work around this bug for now by renaming this file, but this bug should be fixed. Moreover, it looks like the copy module looks for an argument called “raw” (according to the top of the module) but it isn’t documented.

Regards,

Anand

This is a known issue, we’re probably looking to cut a minor update to 1.3.X to include a fix for this, likely this Friday.

The fix is already applied to the development branch.