pyinfra — agentless infrastructure automation, in plain Python

pyinfra — agentless infrastructure automation, in plain Python

pyinfra — 基于纯 Python 的无代理基础设施自动化工具

def pure(): Just Python. No yaml. No jinja-in-yaml. Real control flow. Your editor already understands it. def pure(): 纯 Python。没有 YAML,没有 YAML 里的 Jinja。拥有真正的控制流。你的编辑器已经完全支持它。

def fast(): Concurrent ssh. 6× faster than ansible on identical workloads. Built on gevent + SSH. def fast(): 并发 SSH。在相同工作负载下,速度比 Ansible 快 6 倍。基于 gevent + SSH 构建。

def safe(): Diff before apply. Run --dry to preview every change. Operations are idempotent — re-runs are no-ops. def safe(): 应用前先对比(Diff)。运行 --dry 参数即可预览每一次变更。操作具有幂等性——重复运行不会产生任何副作用。

def small(): 0 agents. Only requirement on hosts: a shell and ssh. No daemons. No state files. No control plane. def small(): 零代理。对主机的唯一要求是拥有 Shell 和 SSH。无需守护进程,无需状态文件,无需控制平面。

def big(): Scale-ready. Works on 1 host or 10,000. Parallel execution, realtime streaming output. def big(): 规模化就绪。无论是 1 台主机还是 10,000 台都能胜任。支持并行执行和实时流式输出。

def open(): Hackable. Custom operation in 10 lines. Connect to anything that speaks a shell — docker, lxc, k8s. def open(): 高度可扩展。只需 10 行代码即可编写自定义操作。可连接任何支持 Shell 的环境——如 Docker、LXC、K8s 等。