Minimum switch/router config needed to connect with Ansible

168 Views Asked by At

So we're considering using Ansible to automate all our network device builds from the point of taking the devices (routers, switches, firewalls) out of thier boxes and racking them, to a fully operational network.

Now, i understand that Ansible connects via SSH which is great however, there must be at least some minimal config on these devices before ansible can connect and configure them.

Does anyone have any idea what the best way to deal with this problem is? Is it a case of manually adding a simple script to each device in order to give it an IP address or is there a more clever (automated) way of doing it?

2

There are 2 best solutions below

2
On

Well you could create a script that writes the basic configs (ip address, ssh connections etc..) and that makes several configs with different ip addresses. Then you simply add it on a USB stick and transfer the appropriate config (ex. SW1 conf or R1 conf) to SW1 or R1. Otherwise I think it's adding it manually which will take a good while if it is a big network with many devices.

Alt. is to make a script as I described and have it uploaded to a FTP server but then again you will manually add these configs and do some pre config. So there is no ultra easy solution sadly (that I know of).

0
On

Ok after some posting on reddit and on the Ansible IRC the Answer is to use Zero Touch Provisioning!