# An unexpected error while registering a variable  -  "unhashable type: 'list'"

**URL:** <https://forum.ansible.com/t/an-unexpected-error-while-registering-a-variable-unhashable-type-list/29520>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [January 24, 2019, 6:49pm UTC](https://forum.ansible.com/t/an-unexpected-error-while-registering-a-variable-unhashable-type-list/29520 "2019-01-24T18:49:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Markiewicz](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Michal\_Markiewicz](https://forum.ansible.com/u/Michal_Markiewicz)\
**Post date:** [January 24, 2019, 6:49pm UTC](https://forum.ansible.com/t/an-unexpected-error-while-registering-a-variable-unhashable-type-list/29520/1 "2019-01-24T18:49:48Z")

</div>

Hi, I’m trying to automate the process of setting up kubernetes cluster for training purposes.

The tasks to register the command for joining workers to a cluster is as follows:

`

- name: get join token for workers  
shell: kubeadm token create --print-join-command  
register: token  
`

I run the playbook in verbose mode and I can see that the command executes properly, but the output can not be registered as there is an unexpected exception:

`  
“rc”: 0,  
“start”: “2019-01-24 17:46:01.951209”,  
“stderr”: “”,  
“stderr\_lines”: ,  
“stdout”: “kubeadm join 192.168.0.22:6443 --token gh0qup.pxkqnbnr3w0gj4at --discovery-token-ca-cert-hash sha256:b1d05a9a32918aa7ea84f73742b104856585a56e9cc31bbed6774d1a10ecaed0”,  
“stdout\_lines”: [  
“kubeadm join 192.168.0.22:6443 --token gh0qup.pxkqnbnr3w0gj4at --discovery-token-ca-cert-hash sha256:b1d05a9a32918aa7ea84f73742b104856585a56e9cc31bbed6774d1a10ecaed0”  
]  
}  
ERROR! Unexpected Exception, this is probably a bug: unhashable type: ‘list’  
the full traceback was:

Traceback (most recent call last):  
File “/usr/bin/ansible-playbook”, line 118, in   
exit\_code = cli.run()  
File “/usr/lib/python2.7/dist-packages/ansible/cli/playbook.py”, line 122, in run  
results = pbex.run()  
File “/usr/lib/python2.7/dist-packages/ansible/executor/playbook\_executor.py”, line 159, in run  
result = self.\_tqm.run(play=play)  
File “/usr/lib/python2.7/dist-packages/ansible/executor/task\_queue\_manager.py”, line 290, in run  
play\_return = strategy.run(iterator, play\_context)  
File “/usr/lib/python2.7/dist-packages/ansible/plugins/strategy/linear.py”, line 248, in run  
task\_vars = self.\_variable\_manager.get\_vars(play=iterator.\_play, host=host, task=task)  
File “/usr/lib/python2.7/dist-packages/ansible/vars/manager.py”, line 418, in get\_vars  
all\_vars[‘ansible\_delegated\_vars’] = self.\_get\_delegated\_vars(play, task, all\_vars)  
File “/usr/lib/python2.7/dist-packages/ansible/vars/manager.py”, line 511, in \_get\_delegated\_vars  
if delegated\_host\_name in delegated\_host\_vars:  
TypeError: unhashable type: ‘list’

`

I’m running the playbook on Centos7 minimal and the ansible version is:

`ansible --version ansible 2.5`

Can someone help here? I was googling for a while but didn’t find the answer…

Regards,  
Michal

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 24, 2019, 6:54pm UTC](https://forum.ansible.com/t/an-unexpected-error-while-registering-a-variable-unhashable-type-list/29520/2 "2019-01-24T18:54:23Z")

</div>

I’d have to guess that you gave a list to delegate\_to somewhere. Instead of a single value
