Ansible: module is missing interpreter line

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

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Leave a comment?

Leave a Reply