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
    vars:
      csvfile: "{{ lookup('csvfile', 'file=file.csv delimiter=,') }}"
      
    tasks:
      - 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
  

Thanks.


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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/353fcee5-0cbc-476c-8a74-84627e14de3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to