maybe I am just blind but I spend today 2 hours to found out how to read from a CSV to create User at the moment I have something like
`
`
hosts: all
user:
name=“{{ lookup(‘csvfile’, ‘item file=user.csv delimiter=, col=0’) }}”
`
`
and a CSV-File that looks like
`
jdoe
jkirk
bwillis
`
I already know that I have to declare the “item” Variable so I can iterate through the user.csv but I don’t can figured out how, maybe someone here can give me a little how to define the item-Variable I would very thanksful
best regards
Dan
your current csv file doesn’t really looks like a csv file The item variable which you are refering to is the key which jinja will use to give you the right csv- row. I am guessing that there will be some more values than the name in the future, so you could iterate over the first column with “with_lines” and use the lookup feature to get the other values.
Like this