# 'tuple' object has no attribute 'iteritems'

**URL:** <https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959>\
**Category:** Ansible Project\
**Created:** [August 6, 2015, 1:19am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959 "2015-08-06T01:19:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randy\_Bush](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Randy\_Bush](https://forum.ansible.com/u/Randy_Bush)\
**Post date:** [August 6, 2015, 1:19am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959/1 "2015-08-06T01:19:02Z")

</div>

- name: run syslog-ng version  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command: syslog-ng --version  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: ver\_out  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changed\_when: false

&nbsp;&nbsp;&nbsp;&nbsp;- name: set ver  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set\_fact: ver="{{ ver\_out.stdout.splitlines()[0]|regex\_replace('[^\d.]+', '') }}"

is getting me

fatal: [frobnitz.edu]: FAILED! =\> {"msg": "Traceback (most recent call last):  
&nbsp;&nbsp;File \"/root/.ansible/tmp/ansible-tmp-1438822667.55-270531375236680/command\", line 2106, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;main()  
&nbsp;&nbsp;File \"/root/.ansible/tmp/ansible-tmp-1438822667.55-270531375236680/command\", line 158, in main  
&nbsp;&nbsp;&nbsp;&nbsp;module = CommandModule(argument\_spec=dict())  
&nbsp;&nbsp;File \"/root/.ansible/tmp/ansible-tmp-1438822667.55-270531375236680/command\", line 607, in \_\_init\_\_  
&nbsp;&nbsp;&nbsp;&nbsp;self.\_check\_for\_check\_mode()  
&nbsp;&nbsp;File \"/root/.ansible/tmp/ansible-tmp-1438822667.55-270531375236680/command\", line 1133, in \_check\_for\_check\_mode  
&nbsp;&nbsp;&nbsp;&nbsp;for (k,v) in self.params.iteritems():  
AttributeError: 'tuple' object has no attribute 'iteritems'  
", "failed": true, "changed": false, "parsed": false, "invocation": {"module\_name": "command", "module\_args": {"\_raw\_params": "syslog-ng --version"}}}

clue bat, please

randy

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://forum.ansible.com/u/Brian_Candler)\
**Post date:** [August 7, 2015, 6:28am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959/2 "2015-08-07T06:28:41Z")

</div>

Which version of ansible?

As a standalone test case, it works for me with ansible-1.7.1.

brian@wrn-mon1:~$ cat test.yml

- hosts: localhost  
tasks:

- name: run syslog-ng version  
command: syslog-ng --version  
register: ver\_out  
changed\_when: false

- name: set ver  
set\_fact: ver=“{{ ver\_out.stdout.splitlines()[0]|regex\_replace(‘[^\d.]+’, ‘’) }}”

- debug: msg=“answer={{ ver }}”  
brian@wrn-mon1:~$ ansible-playbook test.yml

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK: [run syslog-ng version] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK: [set ver] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK: [debug msg=“answer={{ ver }}”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: “answer=3.3.4”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=4 changed=0 unreachable=0 failed=0

brian@wrn-mon1:~$ ansible-playbook --version  
ansible-playbook 1.7.1

---

<div class="post-metadata">

**Author:** ![Randy\_Bush](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Randy\_Bush](https://forum.ansible.com/u/Randy_Bush)\
**Post date:** [August 7, 2015, 7:05am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959/3 "2015-08-07T07:05:50Z")

</div>

> Which version of ansible?

\<blush\> sorry.

% ansible-playbook --version  
ansible-playbook 2.0.0  
&nbsp;&nbsp;config file =  
&nbsp;&nbsp;configured module search path = None

> As a standalone test case, it works for me with ansible-1.7.1.

ouch!

randy

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://forum.ansible.com/u/Brian_Candler)\
**Post date:** [August 7, 2015, 7:25am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959/4 "2015-08-07T07:25:34Z")

</div>

Is that a development version? I've done a "git pull" and the latest \*tagged\* version is v1.9.2-1, although there is a \*branch\* called v2\_final

But if I checkout the latest git devel branch, I get the same as you (below).

Suggest you raise it directly on github, as there's now a nice standalone test case. In fact, the test case reduces to just this:

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://forum.ansible.com/u/Brian_Candler)\
**Post date:** [August 7, 2015, 7:28am UTC](https://forum.ansible.com/t/tuple-object-has-no-attribute-iteritems/18959/5 "2015-08-07T07:28:34Z")

</div>

Is that a development version? I’ve done a “git pull” and the latest _tagged_ version is v1.9.2-1, although there is a _branch_ called v2\_final

If I checkout the latest git devel branch, I see the same as you.

I suggest you raise it directly on github. The following standalone playbook reproduces it, without any need for syslog-ng:
