strange creating directory with delegate_to

when running

`

  • debug: var=groups.control

  • name: Create facts.d directory on ops-control
    file:
    state: directory
    path: /etc/ansible/facts.d
    sudo: yes
    delegate_to: “{{groups.control}}”
    `

i get

`
TASK: [debug var=groups.control] **********************************************
ok: [127.0.0.1] => {
“var”: {
“groups.control”: [
“10.0.196.112”
]
}
}

TASK: [Create facts.d directory on ops-control] *******************************
fatal: [127.0.0.1 → [u’10.0.196.112’]] => Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 582, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 785, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 923, in _executor_internal_inner
delegate = self._compute_delegate(actual_pass, inject)
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 363, in _compute_delegate
delegate[‘user’] = self._compute_delegate_user(self.delegate_to, delegate[‘inject’])
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 393, in _compute_delegate_user
if host in inject[‘hostvars’]:
TypeError: unhashable type: ‘list’
`

I’ve not yet seen this kind of error yet.

delegate_to does not take lists, groups.control is a list, you need to
give it a single item or use with_items to cycle through the list.

In any case this is a bug as you should not get a traceback, but a
nice error message that tells you something similar to what i said
above.

Ah, yes. Thanks!

This should be fixed in 2.0 (current devel)