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.
More on Kubernetes, Docker & SSH clients
How does the official Kubernetes Python client authenticate?BeginnerHow do you list pods with high restart counts using the Python client?BeginnerHow do you patch or scale a Deployment with the Python client?IntermediateHow does `watch.Watch()` work, and what is a `410 Gone`?AdvancedHow do you apply a YAML manifest from Python?AdvancedHow do you use the Docker SDK for Python?Beginner