Re: [ansible-project] lookup csvfile with_items issue

2015-07-08 Thread Bart Pit
Any ideas on the delimiter must be string, not unicode error? Op dinsdag 7 juli 2015 23:55:34 UTC+2 schreef Bart Pit: 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 +

[ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Bart Pit
Hi! I'm struggling to get 'lookup' with 'csvfile' in combination with 'with_items' to work. I have this csv file (shortened snippet): col1,col2 1,Mike 2,Sally Than I also have this var: test_ids: - 1 - 2 Now I want to lookup (docs:

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread 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

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Bart Pit
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

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread 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.