Extract the output to excel files

30 views
Skip to first unread message

Kefi Ammar

unread,
Jan 29, 2019, 9:21:05 AM1/29/19
to Ansible Project
Hello everyone,

I am new to Ansible and I am using it for network operations. So, I am extracting informations from network devices (software versions, platforms, hostnames, interfaces, system infos,...) and they are presented in a messy way that makes it hard to read or organise especially for an important number of devices.

I am asking if there is modules or something that Ansible can do to extract these informations to an excel file or maybe in a .csv file that can be structured. Anyone has an experience with the management and health check of network devices (Cisco and Juniper) using Ansible could help me out.

I am using Ansible 2.7.5

Thank you.

Best regards,
Ammar

sajal tiwari

unread,
Jan 29, 2019, 10:57:48 AM1/29/19
to Ansible Project
You can check Napalm ansible module for extracting information mentioned by you.

Diptajeet Khan

unread,
Jan 29, 2019, 9:03:09 PM1/29/19
to ansible...@googlegroups.com
Hi Kefi,

Ansible I believe natively doesn't support write back to Excel. You can use some python scripts to write back facts/results from ansible to excel though. Actually that's what I am also doing with Cisco Nexus devices.

About Napalm, need to explore if it really can write back to excel.

BR

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3080187a-984a-4f81-8913-35de98dd7b73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bikram40

unread,
Jan 30, 2019, 12:36:59 AM1/30/19
to ansible...@googlegroups.com
Hi Kefi,

You can do something like this. echo your result and redirect the result to a csv. Later open with excel.

- name: Output Information to CSV file

  shell: echo {{inventory_hostname}}, {{ difference_7010.stdout }}>>  mismatched_qos.csv

  delegate_to: localhost


Thanks.

Bikram


--
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 post to this group, send email to ansible...@googlegroups.com.

Kefi Ammar .

unread,
Jan 30, 2019, 10:11:59 AM1/30/19
to ansible...@googlegroups.com
Hello everyone,

I've already tried to extract in csv then opened it with excel but I did not really like the output, I think it needs some more "polishing".

Now I'm exploring napalm hopefully to get a good and readable results with it.

Thanks
Ammar

Reply all
Reply to author
Forward
0 new messages