# Looking to add network CLI support for our operating system. Can any ansible expert please point us to sample code/steps/docs

**URL:** <https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747>\
**Category:** Collection Development\
**Tags:** network\
**Created:** [August 8, 2024, 7:55pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747 "2024-08-08T19:55:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen.kumsagi](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@praveen.kumsagi](https://forum.ansible.com/u/praveen.kumsagi)\
**Post date:** [August 8, 2024, 7:55pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/1 "2024-08-08T19:55:52Z")

</div>

Looking to add network CLI support for our operating system. Can any ansible expert please point us to sample code/steps/docs

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [August 9, 2024, 12:40pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/2 "2024-08-09T12:40:17Z")

</div>

Welcome to the forum, @praveen.kumsagi .

That is a rather vague request.

- What is your operating system?

- What do you mean by “network CLI support”? That could be interpreted as installing openssh servers, or nmcli, … But what operating system doesn’t come with network CLI support out of the box?

In any case, the general answer is to figure out the steps you’d need to do manually to accomplish your goal, then use Ansible to automate those steps. It isn’t clear whether you’re asking for help automating a process vs. defining the steps of a process regardless of automation.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 9, 2024, 1:07pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/3 "2024-08-09T13:07:23Z")

</div>

I think @praveen.kumsagi means the [ansible.netcommon.network\_cli connection plugin](https://docs.ansible.com/ansible/devel/collections/ansible/netcommon/network_cli_connection.html), which is a way to handle network devices via SSH that do not have something close enough to regular shell access.

I’m not very familiar with it, I only know it from the community.mikrotik collection (which I help maintaining) - MikroTik devices offer an interface over SSH that’s not a shell at all, but accepts MikroTik-specific commands and outputs results as text with all kind of ANSI sequences inserted for nice TTY output. From my experience with it I would prefer any kind of API access over network\_cli, since it’s generally a lot cleaner than parsing text output, but sometimes it’s hard to avoid 🙂

The network-wg group ([Ansible network automation working group - Ansible](http://forum.ansible.com/g/network-wg)) links to [networking-docs/network\_dev\_network\_cli.rst at main · ansible-network/networking-docs · GitHub](https://github.com/ansible-network/networking-docs/blob/main/network_dev_network_cli.rst) BTW. That document seems to be outdated though (f.ex. some links have been dead since early 2020).

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 9, 2024, 1:08pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/4 "2024-08-09T13:08:51Z")

</div>

(I moved this to the `Collection Development` category and added the `network` tag. I think both are more appropriate than `Get Help` and no tag, since this is clearly a development question.)

---

<div class="post-metadata">

**Author:** ![praveen.kumsagi](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@praveen.kumsagi](https://forum.ansible.com/u/praveen.kumsagi)\
**Post date:** [August 9, 2024, 11:17pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/5 "2024-08-09T23:17:44Z")

</div>

Hi felixfontein/Todd Lewis, Really appreciate your response, Yes FelixFontein is correct, we are looking to add ansible.netcommon.network\_cli connection plugin for our Network Operating, similar to Cisco/Juniper/Arista.

I was looking for something like ios.py sample from below link but its not available, If you point me to sample file we can start working on it [https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/terminal/ios.py](https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/terminal/ios.py)

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 10, 2024, 6:16am UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/6 "2024-08-10T06:16:20Z")

</div>

If you want a random example of how using network\_cli looks like:

- [community.routeros/plugins/cliconf/routeros.py at main · ansible-collections/community.routeros · GitHub](https://github.com/ansible-collections/community.routeros/blob/main/plugins/cliconf/routeros.py)
- [community.routeros/plugins/terminal/routeros.py at main · ansible-collections/community.routeros · GitHub](https://github.com/ansible-collections/community.routeros/blob/main/plugins/terminal/routeros.py)
- [community.routeros/plugins/module\_utils/routeros.py at main · ansible-collections/community.routeros · GitHub](https://github.com/ansible-collections/community.routeros/blob/main/plugins/module_utils/routeros.py)
- [community.routeros/plugins/modules/command.py at main · ansible-collections/community.routeros · GitHub](https://github.com/ansible-collections/community.routeros/blob/main/plugins/modules/command.py)

Someone from the Network group should be able to point you to maybe better examples (this collection didn’t have involvement from the Ansible Network Team, so no idea whether it’s a good example or not).

---

<div class="post-metadata">

**Author:** ![praveen.kumsagi](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@praveen.kumsagi](https://forum.ansible.com/u/praveen.kumsagi)\
**Post date:** [August 12, 2024, 7:01pm UTC](https://forum.ansible.com/t/looking-to-add-network-cli-support-for-our-operating-system-can-any-ansible-expert-please-point-us-to-sample-code-steps-docs/7747/7 "2024-08-12T19:01:49Z")

</div>

Thank you @felixfontein for these examples
