Can Ansible automate ssh configuration on network devices??

58 views
Skip to first unread message

Mian.M Talha Iqbal

unread,
Feb 9, 2021, 11:30:19 PM2/9/21
to Ansible Development
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.


Paul Belanger

unread,
Feb 10, 2021, 9:09:29 AM2/10/21
to Mian.M Talha Iqbal, Ansible Development
On Tue, Feb 09, 2021 at 08:30:19PM -0800, Mian.M Talha Iqbal wrote:
> 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:

arista eos
cisco ios
ciscoi iosxr
juniper junos
plus more

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

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-ios-appliance/files/bootstrap.yaml
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-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:

https://docs.ansible.com/ansible/latest/network/index.html

Paul

> --
> You received this message because you are subscribed to the Google Groups "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/469bfcb3-48d4-4cbb-acb5-070c99d41f99n%40googlegroups.com.

Wilber H

unread,
May 4, 2021, 7:58:43 PM5/4/21
to Ansible Development
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.

Masood Kharooti

unread,
May 10, 2021, 3:50:58 PM5/10/21
to Ansible Development
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, 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
Reply all
Reply to author
Forward
0 new messages