Interview Prep/Python for DevOps/Kubernetes, Docker & SSH clients

When would you write Python with paramiko/fabric instead of using Ansible?

IntermediateConceptKubernetes, Docker & SSH clients
Answer

Use Ansible for configuration management across a fleet: idempotent modules, inventory, roles, facts, check mode, and a shared language your team already reads. Use Python SSH libraries for targeted tooling where you need logic Ansible makes awkward: a custom health probe that parses output and decides the next step, a bastion-hopping diagnostic CLI, or embedding SSH inside a larger Python service. Avoid reimplementing package/service/file management in paramiko; that is reinventing Ansible badly.

All Python for DevOps questions Roadmap: Python for automation

More on Kubernetes, Docker & SSH clients