# Can Ansible automate ssh configuration on network devices??

**URL:** <https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600>\
**Category:** Ansible Developer\
**Created:** [February 10, 2021, 4:30am UTC](https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600 "2021-02-10T04:30:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mian.M\_Talha\_Iqbal](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mian.M\_Talha\_Iqbal](https://forum.ansible.com/u/Mian.M_Talha_Iqbal)\
**Post date:** [February 10, 2021, 4:30am UTC](https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600/1 "2021-02-10T04:30:19Z")

</div>

I’ve been working with ansible for a little while now and it’s really awesome.  
We can manage a large number of networking devices with a single machine.  
But for that we need to establish a manual connection with the devices using telnet or ssh protocol.  
Now the question is that, Is there any way to automate the process of ssh configuration on these networking devices?? **or is it compulsory to establish a manual connection before we can start automating the network.**  
**If there is any way to automate this process please mention.**

---

<div class="post-metadata">

**Author:** ![Paul\_Belanger](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Paul\_Belanger](https://forum.ansible.com/u/Paul_Belanger)\
**Post date:** [February 10, 2021, 2:09pm UTC](https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600/2 "2021-02-10T14:09:16Z")

</div>

> I've been working with ansible for a little while now and it's really  
> awesome.  
> We can manage a large number of networking devices with a single machine.  
> But for that we need to establish a manual connection with the devices  
> using telnet or ssh protocol.  
> Now the question is that, Is there any way to automate the process of ssh  
> configuration on these networking devices?? \*or is it compulsory to  
> establish a manual connection before we can start automating the network.\*
> 
> \*If there is any way to automate this process please mention.\*

Yes, it is possible. We do a large amount of CI testing for network  
appliances, for example:

&nbsp;&nbsp;arista eos  
&nbsp;&nbsp;cisco ios  
&nbsp;&nbsp;ciscoi iosxr  
&nbsp;&nbsp;juniper junos  
&nbsp;&nbsp;plus more

Here are a few example playbooks of how to bootstrap them:

&nbsp;&nbsp;[https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-eos-appliance/files/bootstrap.yaml](https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-eos-appliance/files/bootstrap.yaml)  
&nbsp;&nbsp;[https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-ios-appliance/files/bootstrap.yaml](https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-ios-appliance/files/bootstrap.yaml)  
&nbsp;&nbsp;[https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-iosxr-appliance/files/bootstrap.yaml](https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-iosxr-appliance/files/bootstrap.yaml)  
&nbsp;&nbsp;[https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-junos-appliance/files/bootstrap.yaml](https://github.com/ansible/ansible-zuul-jobs/blob/master/playbooks/ansible-network-junos-appliance/files/bootstrap.yaml)

In most cases, we use the default credentials to connect. Then create  
the new users, SSH public key and remove the original admin. It is 100%  
automated.

For more information look at:

&nbsp;&nbsp;[https://docs.ansible.com/ansible/latest/network/index.html](https://docs.ansible.com/ansible/latest/network/index.html)

Paul

---

<div class="post-metadata">

**Author:** ![Wilber\_H](https://avatars.discourse-cdn.com/v4/letter/w/df788c/32.png) [@Wilber\_H](https://forum.ansible.com/u/Wilber_H)\
**Post date:** [May 4, 2021, 11:58pm UTC](https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600/3 "2021-05-04T23:58:43Z")

</div>

Hi - thanks for the playbook samples.

Question - Do you have similar playbook but for connecting to a BigSwitch device over ssh through a terminal server?

p.s. BigSwitch is now part of Arista since 2020 but I don’t think the “ansible\_network\_os: eos” works to connect to BigSwitch devices over ssh through a terminal server.

---

<div class="post-metadata">

**Author:** ![Masood\_Kharooti](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@Masood\_Kharooti](https://forum.ansible.com/u/Masood_Kharooti)\
**Post date:** [May 10, 2021, 7:50pm UTC](https://forum.ansible.com/t/can-ansible-automate-ssh-configuration-on-network-devices/34600/4 "2021-05-10T19:50:58Z")

</div>

Hello,

I have the Ansible and Sensu Go environment installed in my infrastructure for automation and monitoring, so to automate the power cycle for devices at the outlet level we use Triple-Lite Smart PDUs **[https://www.tripplite.com/support/PDUMH15NET2LX,](https://www.tripplite.com/support/PDUMH15NET2LX,)** but we do not have the right process to build inventory list, write playbooks, connect the PDU with Sensu Go through scripting, and test the solution.

Any assistance is much appreciated.

Please do not hesitate to ask should you need further detail from me.

Thank you in advance!

Very best,  
Masood
