CSV to JSON

209 views
Skip to first unread message

shyam rpm

unread,
May 20, 2020, 2:07:50 PM5/20/20
to Ansible Project
Hi,

Is it possible to convert CSV file to JSON format using Ansible modules, I have searched for the modules have't found. Or else do we need to use any scripting language to achieve this powershell or python ?





Thank you,
Shyam.

Antony Stone

unread,
May 20, 2020, 3:06:31 PM5/20/20
to ansible...@googlegroups.com
On Wednesday 20 May 2020 at 20:07:50, shyam rpm wrote:

> Hi,
>
> Is it possible to convert CSV file to JSON format using Ansible modules,

Thsi really sounds like the wrong tool for the job, to me.

> Or else do we need to use any scripting language to achieve this powershell
> or python ?

I've no idea about powershell (but I don't think it would be easy).

Python could do it, perl could do it, and you might want to investigate
telegraf.


Regards,

Antony.

--
Users don't know what they want until they see what they get.

Please reply to the list;
please *don't* CC me.

Dominik Bessler

unread,
May 20, 2020, 6:32:43 PM5/20/20
to ansible...@googlegroups.com
Take a Look at Miller. 

Brian Coca

unread,
May 20, 2020, 8:44:04 PM5/20/20
to Ansible Project
As already mentioned, Ansible is not the best tool for data conversion
... however, the csv lookup and a template with the to_json filter CAN
do the work .



--
----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages