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

19 views
Skip to first unread message

Michał Markiewicz

unread,
Jan 24, 2019, 1:49:48 PM1/24/19
to Ansible Project
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 <module>
    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

Matt Martz

unread,
Jan 24, 2019, 1:54:48 PM1/24/19
to ansible...@googlegroups.com
I'd have to guess that you gave a list to delegate_to somewhere. Instead of a single value

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a2ae851f-40b8-4aab-8cd8-a5305741ea87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages