How do I loop over each line inside a file with ansible? September 25, 2023 by Tarik I managed to find an easy alternative: - debug: msg="{{item}}" with_lines: cat files/branches.txt