Can we perform the code upgrades for the Cisco or Juniper routers? Say if we have 600 routers in the network, the way it worked is to upgrade one by one and it would take forever to upgrade all of them. As Ansible doesn’t have to be installed on the client machine, can we upgrade the network elements like 10 at a time?
Can someone share a usecase. I know we can run the show commands but interested to know if we can perform the actual code upgrades.
Ansible is inherently parallel when executing the same task across multiple hosts (eg, "ensure firmware version X.Y.Z on - it defaults to a fairly low number of “forks”, but if you run it on beefy enough hardware, can easily manage hundreds (and in some cases thousands) of devices/hosts in parallel.
I don’t think we ship any integrated firmware upgrade modules “in the box”, but I’ve successfully written and deployed custom Ansible modules for ASA and Catalyst firmware upgrades and used them to manage devices at scale (this was before we had command modules for any of those devices). You can probably manage a firmware upgrade using the stuff we have in the box now (check version, make room for + push new binary if necessary, issue upgrade command, reboot), but I’ve never tried it that way.
I wrote an Ansible playbook the other day to automate the upgrade of Cisco IOS routers. See the link below. Ansible by default launches 5 parallel connections but you can bump up the number easily to speed up the process if you have many routers.