I would like to create a playbook that reads a local file to a var, Then be able to loop through this var line by line and use the lines in a task.
To get the file content i used:
file_contents: "{{lookup('file', './myfile.txt')}}"
I tried using:
- with_file
- with_item
- with_lines
But I did not get the result i wanted.
any help would be appreciated.