There is a version of this task that fits in twenty lines of shell: read 50 management IPs, SSH into each, paste the config, run write memory, move on. It works in the lab. In production it fails the same way about four times out of ten — one device holds a stale config lock, the loop does not notice, and you find out hours later when a distribution switch reloads into the old config. Pushing to 50 switches at once is not a scripting problem. It is a rollback and reconciliation problem that happens to involve SSH.

The loop is trivial; the failure modes are not

A serial loop over 50 devices costs a realistic 20 seconds per device: 2s for auth through TACACS+, 6s to paste 40 lines, 4s for write memory on an older supervisor, 8s to verify. That is 1,000 seconds of change window — 17 minutes where nothing else can happen. Run the same push at 8-way concurrency and it collapses to roughly 2.5 minutes.

Concurrency is only safe if you have handled two things:

  • vty line count. Most IOS platforms ship with five vty lines (0–4). Eight parallel sessions to eight different devices is fine. Eight sessions to the same device — which happens the moment your orchestrator retries — is not.
  • AAA throttling. Your TACACS+ server has a rate limit nobody wrote down. Fifty auth requests in two seconds will find it.

Then come the failure modes that never appear at three devices: a config lock held by a dead session, IOS versus IOS-XE differences in how archive behaves, logging synchronous rewriting your terminal mid-paste so the config parses but only partially applies, and devices where write memory succeeds while the boot variable still points somewhere else.

Pre-flight is what you are actually building

The push is a paste. The pre-flight is the product. Five steps, and skipping any one turns a change into an incident.

  1. Pre-flight — reachability, privilege level, free NVRAM, current config checksum, boot variable.
  2. Snapshot — full show running-config per device, stored with a hash and a timestamp. This is your rollback artifact; without it, rollback is a guess.
  3. Push — one bounded block, not forty individual commands over the channel. Atomic paste is far more reliable than looping send_command calls.
  4. Verify — an assertion, not a return code. BGP neighbor count, interface state, a diff of actual against intent.
  5. Commit — write memory only after verify passes. A device that fails verify stays uncommitted, and a reload still brings back the old running config.

The snapshot costs roughly 4 seconds per device. That is the difference between a rollback measured in minutes and one measured in hours of someone typing from a wiki page.

A push you cannot undo across all 50 devices is not a change, it is an outage with a scheduled start time.

At 50 devices, partial failure is the expected case

Do the arithmetic before you book the window. If a single device has a 1% chance of failing for any reason — transient auth, a held lock, a bad line in the per-device template — the probability that at least one of 50 fails is 1 − 0.99^50, or about 40%. At 5% per device it is 92%. You do not get to plan for zero failures. You get a reconciliation loop: re-run the batch against the failed set only, up to N times, behind the same pre-flight guards.

The loop must be idempotent. Applying the same block twice should be a no-op, which means writing explicit no forms and replacing whole sections rather than appending, or using config replace where the platform supports it. A loop that appends will slowly poison 50 devices with duplicated config over a year of change windows.

Ring the rollout instead of flattening it

50 is small enough that people push everything at once. Do not.

  • Ring 0: two devices, ideally the pair that matters least, pushed with someone watching.
  • Ring 1: eight devices, unattended, after Ring 0 has held stable for a full business day.
  • Ring 2: the remaining 40, batched at your concurrency cap, with the reconciliation loop enabled.

The cost is one extra day of calendar time. The benefit is a blast radius of two devices. For anything touching routing or spanning-tree, that trade is not close.

Tooling is the least interesting decision

Ansible, Nornir with Netmiko, or a direct NETCONF/RESTCONF client will all push to 50 switches. What separates them at this scale is unglamorous:

  • Does the library paste a block atomically, or issue one command per call?
  • Can it detect a partial apply and abort the batch?
  • Does it hand you a structured diff of intended versus actual state, or a wall of text?
  • Can you cap concurrency per device as well as globally?

If the third answer is a wall of text, you will be reading 50 diffs by hand at 2am. Pick the tool that produces the diff, and treat screen-scraping as a fallback for the few platforms with no better interface — not as the architecture.

Where this is going

The 50-switch push is a transitional problem, and it exists for one reason: intended state lives in a repo while actual state lives on the device, so every change must be distributed and then re-discovered. The direction of travel is declared intent in a source of truth, continuous drift detection, and an agent that reconciles one switch exactly the way it reconciles fifty — because the unit of work becomes a diff, not a script. Change windows disappear when a push stops being an event and starts being a control loop. Until then, the teams that push to 50 safely are the ones that treat the rollback path as the deliverable and the push as a side effect.