# packages = p\['package'\].split(',')\\r\\nAttributeError:

**URL:** <https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728>\
**Category:** Ansible Project\
**Created:** [March 1, 2016, 4:59pm UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728 "2016-03-01T16:59:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hilali\_lui](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hilali\_lui](https://forum.ansible.com/u/hilali_lui)\
**Post date:** [March 1, 2016, 4:59pm UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728/1 "2016-03-01T16:59:04Z")

</div>

Hello,

When I use this:

- name: Install {{ install\_name }} required tools  
apt: pkg={{ item }}  
state=installed  
update\_cache=yes

I found this error :

failed: [192.168.8.123] =\> (item=[u’sudo’, u’vim’, u’tree’, u’git’, u’gcc’, u’iotop’, u’htop’, u’build-essential’, u’xfonts-base’, u’xfonts-encodings’, u’xfonts-75dpi’, u’xfonts-utils’, u’libfontenc1’, u’libffi-dev’, u’libssl-dev’, u’libevent-dev’, u’libgeos-dev’, u’libldap2-dev’, u’libsasl2-dev’, u’libxfont1’, u’libxml2’, u’libxml2-dev’, u’libxslt1.1’, u’libxslt1-dev’, u’libxslt-dev’, u’node-clean-css’, u’node-less’]) =\> {“failed”: true, “invocation”: {“module\_name”: “apt”}, “item”: [“sudo”, “vim”, “tree”, “git”, “gcc”, “iotop”, “htop”, “build-essential”, “xfonts-base”, “xfonts-encodings”, “xfonts-75dpi”, “xfonts-utils”, “libfontenc1”, “libffi-dev”, “libssl-dev”, “libevent-dev”, “libgeos-dev”, “libldap2-dev”, “libsasl2-dev”, “libxfont1”, “libxml2”, “libxml2-dev”, “libxslt1.1”, “libxslt1-dev”, “libxslt-dev”, “node-clean-css”, “node-less”], “module\_stderr”: “OpenSSH\_6.6.1, OpenSSL 1.0.1f 6 Jan 2014\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 20859\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 192.168.8.123 closed.\r\n”, “module\_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1456851197.83-39434127468758/apt", line 2407, in \r\n main()\r\n File "/root/.ansible/tmp/ansible-tmp-1456851197.83-39434127468758/apt", line 448, in main\r\n p’list’ object has no attribute ‘split’\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [March 1, 2016, 11:06pm UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728/2 "2016-03-01T23:06:38Z")

</div>

I just had a few weird attribute errors that were caused by having multiple installations of Ansible. I had a system install and I was trying to use a Github clone of Ansible.

You can use the following command to see where your system Ansible locations might be (thanks to Matt Martz):  
$ python -c “import sys; print sys.path”

---

<div class="post-metadata">

**Author:** ![hilali\_lui](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hilali\_lui](https://forum.ansible.com/u/hilali_lui)\
**Post date:** [March 2, 2016, 8:34am UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728/3 "2016-03-02T08:34:34Z")

</div>

Thank yoou for your reponse I found

ahilali@ahilali-desktop:~$ python -c “import sys; print sys.path”  
[‘’, ‘/usr/local/lib/python2.7/dist-packages/ansible-2.0.0.2-py2.7.egg’, ‘/usr/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-x86\_64-linux-gnu’, ‘/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages/PILcompat’, ‘/usr/lib/python2.7/dist-packages/gtk-2.0’, ‘/usr/lib/pymodules/python2.7’, ‘/usr/lib/python2.7/dist-packages/ubuntu-sso-client’]

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [March 2, 2016, 3:25pm UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728/4 "2016-03-02T15:25:51Z")

</div>

That looks okay, unless you are also running Ansible from the Github repo.

Can you paste the full play here, including the variables that are being read into the play?

Thanks!  
Joanna

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 2, 2016, 11:46pm UTC](https://forum.ansible.com/t/packages-p-package-split-r-nattributeerror/20728/5 "2016-03-02T23:46:07Z")

</div>

that is not a good key=val multiline, do one of these:

apt:  
pkg: “{{ item }}”  
state: installed  
update\_cache: yes

or

apt: |  
pkg={{ item }}  
state=installed  
update\_cache=yes
