Convert Text File To JSON With Ansible

from blog Welcome To A DevOps Blog on Valewood DevOps Consulting, | ↗ original
I was looking through Reddit today and saw an interesting question about how to manipulate files with Ansible. I took a few minutes to throw together an example of how to convert a relatively simple file, a list of strings broken up by new lines, and output it as JSON.