For extra clarification: I started getting this error without the quotes
around the comma. So like this, produces the same error:
debug: msg="{{ lookup('csvfile', item + ' file=test.csv delimiter=, col=2')
}}"
Op dinsdag 7 juli 2015 22:57:47 UTC+2 schreef Bart Pit:
>
> Thanks Brian! It doing something more now, that's good :)
>
> However, I now get this error:
>
> fatal: [localhost] => Failed to template msg="{{ lookup('csvfile', item +
> ' file=test.csv delimiter="," col=2') }}": csvfile: "delimiter" must be
> string, not unicode
>
> I tried quoting the comma, double and single. And tried the approach in
> this thread, both single and double:
> https://groups.google.com/forum/#!topic/ansible-project/r2L3UONwaN0 like
> so:
>
> debug: msg="{{ lookup('csvfile', item + ' file=test.csv delimiter='","'
> col=2') }}"
>
> But also doesn't work.
>
> Any ideas?
>
>
>
> Op dinsdag 7 juli 2015 22:23:18 UTC+2 schreef Brian Coca:
>>
>> you are forcing item to be a static string, it needs to be like this:
>>
>> - name: read from csv file
>> debug: msg="{{ lookup('csvfile', item + ' file=/path/to/file.csv
>> delimiter=, col=1') }}"
>> with_items: test_ids
>>
>> --
>> Brian Coca
>>
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/2a8ec8d9-a545-4ac6-8192-a7eb638ea8c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.