Read the values from file and store in variable.

Hi All,

I have a file named as /etc/oraInst.loc. The file contents are as below.

inventory_loc=/u01/app/oraInventory
inst_group=oinstall

I need to store the value of inventory_loc , that is ,/u01/app/oraInventory in any variable.

These files are at remote host and not on ansible controller host. I used the INI module to read the file stored locally and I could do it but I am not able to read files stored on the remote host and it throws the error saying file is not present. Can you please help me to accomplish this task.

Hi

Why can’t you grep the required output using shell and store in >> remote server.

Or slurp it and parse it with ini:

https://docs.ansible.com/ansible/latest/plugins/lookup/ini.html