Ansible: module is missing interpreter line

This article was published 6 years ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

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.

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

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

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

Thoughts on this post

Leave a comment?