Sorry, but  it's not clear at all how debug iterates over the rows. 
Running a simple debug doesn't help.

For example, if I had a playbook like this (that of course doesn't work), 
how should I fix it
to iterate over every single row and print the value of the 3 columns?

  - hosts: db
    become: true
    remote_user: root
      csvfile: "{{ lookup('csvfile', 'file=file.csv delimiter=,') }}"
      - name: cat
        debug: msg="{{ item.a }} - {{ item.a }} - {{ item.c }}"  #for every 
row print the value of a, b and c columns
        with_items: csvfile


Il giorno mercoledì 21 febbraio 2018 18:58:28 UTC, Brian Coca ha scritto:
> there are plenty of specific examples, just your specific case is not 
> covered, but it is simple enough to inffer from existing ones, 
> something like this should work: 
> - name: show the row 
>   debug: var=item 
>   loop: " {{ lookup('file', '/path/tocsv') }}" 
> you might need to split on ',' if you want the columns, there is a 
> csvfile lookup it it retrieves specific column, not rows 
> -- 
> ---------- 
> 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 post to this group, send email to
To view this discussion on the web visit
For more options, visit

Reply via email to