CMD module complains about exec format error

Hi,

I have a task that copies a folder onto a virtual box machine and then uses the command module to execute a shell script in that remote folder. Ansible always complains with,

msg: [Errno 8] Exec format error

I can easily ssh into that machine and run the same script. The script does have executable mode attributes. I’ve been banging my head against the wall trying to figure this out. Anyone know what this problem is?

-Loc

How about pasting the exact playbook code here?

Couple of things to check, off the top of my head:

  • shebang as a first line for the script? (you probably have if you can run it by hand);
  • non-printable character within the command arguments?
  • space(s) in command args where there should be no space (e.g. ‘key = value’ instead of ‘key=value’)
  • using command module where shell module is needed actually.

(Just my two cents.)
-Yassen