You can read the file contents using the lookup plugin. Once you
have the file contents, you can then try to apply regex filter to
obtain the pattern you need.
Is it possible to use a more structured format like JSON instead
of text file like the one you have? That would make the task a lot
easier.
Sudheer Satyanarayana System Administrator And Developer Tech Chorus - https://www.techchorus.net
Hi Sudheer,Thanks for your update. I want to read the file line by line. is it possible to do through Ansible ?I have tried with Lookup plugin and Im able to save the instance name, HTTP port number and Portnumber in a separate vaiable from CSV file.Here my requirement is to iterate the CSV file contents line by line and need to launch the instances from the CSV file.Any suggestions please.
Hi Sudheer,Thanks for your update. I want to read the file line by line. is it possible to do through Ansible ?I have tried with Lookup plugin and Im able to save the instance name, HTTP port number and Portnumber in a separate vaiable from CSV file.
Here my requirement is to iterate the CSV file contents line by line and need to launch the instances from the CSV file.
If you have a CSV file, us the read_csv module.
https://docs.ansible.com/ansible/devel/modules/read_csv_module.html