How can I automate the deployment of cisco IOS upgrades?

I recently wrote an Ansible module that allows you to use SSH+SCP to transfer a file to Cisco IOS devices.

One of the use cases is obviously transferring IOS images. It has some built-in checks like not transferring the file if it already exists and performing an MD5 comparison (original file to transferred file). The MD5 is CPU intensive on the router, however.

With the module + Ansible you could then pretty easily transfer new IOS images to a set of network devices.

The module can be found here: https://github.com/ktbyers/scp_sidecar.

I also have a write-up about using the module which can be found here: https://pynet.twb-tech.com/blog/automation/cisco-ios.html


{Disclaimer - I work for an HP partner}


What I see most often is the use of a tool like HP Network Automation (which does far more than merely push IOS updates to Cisco devices - it supports all kinds of network devices, does configuration management, can be used for audit compliance, etc).

You might also consider some of the Open Source products like Chef, Puppet, Ansible, CFengine, and others.

It may also be possible to use something like PSSH - but I don't know.


There are many tools but I recommend to using Expect ( http://en.wikipedia.org/wiki/Expect )

Expect has main advantage that it completely simulates command prompt interaction and is very easy to learn and implement. Not mentioning fact it is completely free under GNU/GPL license.

Example:

expect "*assword: "
send "$Password\r"
expect "#"
send "conf t\r"