Hello Ansible folk,
I have a text file of the form:
10.60.43.23 worker22.domain
I was to use the “csvfile” lookup plugin to look up name host name, given an IP address. So I’m trying this:
- name: hostname lookup
debug:
msg: hostname is {{ lookup(“csvfile”,ansible_default_ipv4[“address”]+" file=hostnames.hdp1 delimiter=’ '") }}
However, running this snippet gives me the error:
TASK [hostname lookup] *********************************************************
fatal: [worker22.domain]: FAILED! => {“failed”: true, “msg”: “need more than 1 value to unpack”}
I can’t understand what Ansible is actually failing on. I’ve tried to run with -vvvv, but it seems this error occurs before the debug module is even transferred to the remote host for execution. If anyone knows what this error means, and how I can avoid it, I would greatly appreciate the help.
Regards,
Anand