Read the values from file and store in variable.

10 views
Skip to first unread message

Akshay Bora

unread,
May 26, 2020, 2:14:31 AM5/26/20
to Ansible Project
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.

Sivakumar Saravanamuthu

unread,
May 26, 2020, 2:19:28 AM5/26/20
to ansible...@googlegroups.com
Hi

Why can't you grep the required output using shell and store in >> remote server.
Thank you.
Regards,
Siva


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e7104dcc-1054-4ec4-b898-11cbcf80ddb4%40googlegroups.com.

Dick Visser

unread,
May 26, 2020, 2:53:40 AM5/26/20
to ansible...@googlegroups.com
Or slurp it and parse it with ini:


--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages