Ansible: module is missing interpreter line

03 Apr 2014 in TIL

Whilst trying to run Ansible 1.4.4 (installed from the Ubuntu PPA), I came across the following error:

module is missing interpreter line

I searched for the line in the Ansible code base, and it showed up as line 332 of /usr/local/lib/python2.7/dist-packages/ansible/runner/__init__.py.

python
raise errors.AnsibleError("module is missing interpreter line")

To find out what was causing it, I added a bit of debug information:

python
raise errors.AnsibleError("module is missing interpreter line - %s" % (module_name))

This time, the error message was a bit more useful:

module is missing interpreter line - include_vars

This looked like a bug in the release to me, so I upgraded to the latest version and everything is working fine