# ansible 2.1 setup fails  with this module requires key=value arguments (\['\<\<INCLUDE\_ANSIBLE\_MODULE\_ARGS\>\>'\])

**URL:** <https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 5, 2016, 4:12pm UTC](https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667 "2016-06-05T16:12:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Fausak](https://avatars.discourse-cdn.com/v4/letter/g/a88e4f/32.png) [@Greg\_Fausak](https://forum.ansible.com/u/Greg_Fausak)\
**Post date:** [June 5, 2016, 4:12pm UTC](https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667/1 "2016-06-05T16:12:45Z")

</div>

I am migrating to 2.1 from 1.9. I ran into a few issues, but it has been fairly painless. I’ve run across this, and I have narrowed it down to exactly how to recreate it. Once I get in this state ansible is not usable anymore.

I’ve got a playbook, target is ubuntu 15.10, source is mac osx. i am using vagrant to setup a vm. then i ssh in modifying the ansible.cfg:

[default]

nocows = yes

retry\_files\_enabled = False

remote\_user = vagrant

deprecation\_warnings = False

host\_key\_checking = False

force\_handlers = True

#allow\_world\_readable\_tmpfiles = True

hostfile = /Users/c0faulo/git/vagrant/hosts

[ssh\_connection]

ssh\_args = -F /Users/c0faulo/git/vagrant/machines/blank/.vagrant\_ssh\_config -o ControlMaster=auto -o ControlPersist=30m

scp\_if\_ssh = True

control\_path = ~/.ssh/ansible-%%r@%%h:%%p

If it matters, here is my .vagrant\_ssh\_config file:

Host default

HostName 127.0.0.1

User vagrant

Port 2222

UserKnownHostsFile /dev/null

StrictHostKeyChecking no

PasswordAuthentication no

IdentityFile “/Users/c0faulo/git/vagrant/machines/blank/.vagrant/machines/default/virtualbox/private\_key”

IdentitiesOnly yes

LogLevel FATAL

Everything works in the playbook. When I try to run the playbook again I get this error. By binary search I found the line that messes up my ansible connection:

I have several repos from my accounts that I install, then I run a command (usually python setup.py install) in that repo. Here is the task:

- name: install repos

become: yes

become\_user: “{{item.user}}”

shell: “( cd ~{{login}}/git/{{item.repo}}; {{item.install}})”

with\_items:

“{{ repos }}”

and my repos dictionary:

vars:

repos:

- repo: “gen\_yaml”

org: “VCP”

install: “echo nothing to do”

#install: “python setup.py install”

user: “root”

url: “[http://txslnno-github.cds.eng.vzwcorp.com/VCP/gen\_yaml.git](http://txslnno-github.cds.eng.vzwcorp.com/VCP/gen_yaml.git)”

- repo: “dhcp-pb”

org: “VCP”

install: “echo nothing to do”

user: “{{login}}”

url: “[http://txslnno-github.cds.eng.vzwcorp.com/VCP/dhcp-pb.git](http://txslnno-github.cds.eng.vzwcorp.com/VCP/dhcp-pb.git)”

- repo: “cmdb”

org: “corona”

install: “make site\_torrance”

user: “{{login}}”

url: “[http://txslnno-github.cds.eng.vzwcorp.com/corona/cmdb.git](http://txslnno-github.cds.eng.vzwcorp.com/corona/cmdb.git)”

you can see the install: “echo nothing to to”

When I change that to the python setup.py install, everything works, but then I can’t run ansible again.

Something appears to get messed up in the ansible environment on the target side.

My program ‘gen\_yaml’ is a fairly simple program. It needs pyyaml and psycopg2. I did a manual install and this is the verbose output :

creating dist

creating ‘dist/gen\_yaml-0.1.9-py2.7.egg’ and adding ‘build/bdist.linux-x86\_64/egg’ to it

removing ‘build/bdist.linux-x86\_64/egg’ (and everything under it)

Processing gen\_yaml-0.1.9-py2.7.egg

creating /usr/local/lib/python2.7/dist-packages/gen\_yaml-0.1.9-py2.7.egg

Extracting gen\_yaml-0.1.9-py2.7.egg to /usr/local/lib/python2.7/dist-packages

Adding gen-yaml 0.1.9 to easy-install.pth file

Installing gen\_yaml script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/gen\_yaml-0.1.9-py2.7.egg

Processing dependencies for gen-yaml==0.1.9

Searching for psycopg2==2.6

Best match: psycopg2 2.6

Adding psycopg2 2.6 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages

Finished processing dependencies for gen-yaml==0.1.9

My program gen\_yaml works, and the installation worked, but I can’t access with the ansible anymore?

-g

---

<div class="post-metadata">

**Author:** ![Greg\_Fausak](https://avatars.discourse-cdn.com/v4/letter/g/a88e4f/32.png) [@Greg\_Fausak](https://forum.ansible.com/u/Greg_Fausak)\
**Post date:** [June 6, 2016, 7:13pm UTC](https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667/2 "2016-06-06T19:13:39Z")

</div>

In the last 24 hours I looked all over for this.

If I install _anything_ with python setup.py install I get a failure.

The hint was the output in the setup.py process:

Adding psycopg2 2.6 to easy-install.pth file /usr/local/lib/python2.7/dist-packages/easy-install.pth

I realized I didn’t know what that meant, so I started looking around a little. It turns out there is a file called easy-install.pth that is read by python at a very low level. The contents of my file after Ansible stopped working (after my setup.py):

import sys; sys.\_\_plen = len(sys.path)

./cmdb\_utils-0.0.4-py2.7.egg

./argparse\_config-0.5.1-py2.7.egg

/usr/lib/python2.7/dist-packages

import sys; new = sys.path[sys.\_\_plen:]; del sys.path[sys.\_\_plen:]; p = getattr(sys, ‘\_\_egginsert’, 0); sys.path[p:p] = new; sys.\_\_egginsert = p + len(new)

And the contents of the file before I do a setup.py:

If I edit the file and remove this line:

/usr/lib/python2.7/dist-packages

Then ansible works again.

It has something to do with the order of my apt-gets and my python setup.py installs. II haven’t been able to figure out exactly how to recreate it.

-g

---

<div class="post-metadata">

**Author:** ![Roman\_Gaufman1](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@Roman\_Gaufman1](https://forum.ansible.com/u/Roman_Gaufman1)\
**Post date:** [July 28, 2016, 11:21am UTC](https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667/3 "2016-07-28T11:21:58Z")

</div>

Hi Greg,

I’m experiencing the same thing on 2 servers, rest are fine. I can ssh to them and I cannot see anything obviously wrong:

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

fatal: [0ca87760df7de0fe2d36]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “this module requires key=value arguments ([‘\<\<INCLUDE\_ANSIBLE\_MODULE\_ARGS\>\>’])”}

fatal: [33ac8c46007794dee1a6]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “this module requires key=value arguments ([‘\<\<INCLUDE\_ANSIBLE\_MODULE\_ARGS\>\>’])”}

to retry, use: --limit @timeboxes.retry

I resolved the problem by moving this file out of the way:

sudo mv /usr/local/lib/python2.7/dist-packages/easy-install.pth /usr/local/lib/python2.7/dist-packages/easy-install.pth.backup

Very strange.

---

<div class="post-metadata">

**Author:** ![Adam\_Grant](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Adam\_Grant](https://forum.ansible.com/u/Adam_Grant)\
**Post date:** [August 1, 2016, 11:28pm UTC](https://forum.ansible.com/t/ansible-2-1-setup-fails-with-this-module-requires-key-value-arguments-include-ansible-module-args/21667/4 "2016-08-01T23:28:35Z")

</div>

Hi Roman,  
I believe you are seeing this:

FAILED! =\> {“changed”: false, “failed”: true, “msg”: “this module requires key=value arguments ([‘\<\<INCLUDE\_ANSIBLE\_MODULE\_ARGS\>\>’])”}

because those 2 servers are sourcing local out-of-date ansible.egg files (in their easy-install.pth)? It was the case for me.

This seems to be creating a namespace collision for Ansible 2.1 lib imports when the remote python interpreter is initialized to run python code remotely.

-Adam
