Extract the output to excel files

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

You can check Napalm ansible module for extracting information mentioned by you.

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

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

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