# Junos/Cisco | Compare outputs

**URL:** <https://forum.ansible.com/t/junos-cisco-compare-outputs/29841>\
**Category:** Ansible Project\
**Created:** [March 7, 2019, 5:43pm UTC](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841 "2019-03-07T17:43:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![intelysmark](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@intelysmark](https://forum.ansible.com/u/intelysmark)\
**Post date:** [March 7, 2019, 5:43pm UTC](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841/1 "2019-03-07T17:43:20Z")

</div>

I would like to add some functionality to my Ansible playbooks that does the following; Before making any changes (at beginning of playbook) it runs a number of commands and stores the output of the commands in files. Then when it's finished running, it runs the same commands again and stores to a second set of files. At the end, it then compares those files and if there are any differences, show the differences. The info I would like to gather, are things like;

bgp neighbours

ipsec vpn peers

ospf neighbours

routing table

My logic is that this would be a quick test to make sure nothing has been impacted by the changes in the Ansible playbook.

Does anybody know if this has been done before and if there are example I can copy? If not, any ideas how it can be done?

Thanks

---

<div class="post-metadata">

**Author:** ![vincent\_collier](https://avatars.discourse-cdn.com/v4/letter/v/dc4da7/32.png) [@vincent\_collier](https://forum.ansible.com/u/vincent_collier)\
**Post date:** [March 8, 2019, 2:01am UTC](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841/2 "2019-03-08T02:01:35Z")

</div>

Use this command parser and it will simple to compare those :  
[https://github.com/ansible-network/network-engine/blob/devel/docs/user\_guide/command\_parser.md](https://github.com/ansible-network/network-engine/blob/devel/docs/user_guide/command_parser.md)  
[https://github.com/ansible-network/network-engine/blob/devel/docs/directives/parser\_directives.md](https://github.com/ansible-network/network-engine/blob/devel/docs/directives/parser_directives.md)

You should find example on internet.

---

<div class="post-metadata">

**Author:** ![intelysmark](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@intelysmark](https://forum.ansible.com/u/intelysmark)\
**Post date:** [March 8, 2019, 7:57am UTC](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841/3 "2019-03-08T07:57:10Z")

</div>

Just what I was looking for, thank you.
