• 后端程序员之路 6、Python fabric


    直接写shell固然也很好,但是用python来写脚本,也是美滋滋。
    fabric是一个封装部署、多机操作等功能的python库。

    Welcome to Fabric! — Fabric documentation
    http://www.fabfile.org/index.html

    sudo yum -y install epel-release
    sudo yum -y install python-pip
    pip install --upgrade pip
    pip install fabric

    Python fabric实现远程操作和部署
    http://wklken.me/posts/2013/03/25/python-tool-fabric.html

    fabric全api列表:
    from fabric.context_managers import (cd, hide, settings, show, path, prefix,
        lcd, quiet, warn_only, remote_tunnel, shell_env)
    from fabric.decorators import (hosts, roles, runs_once, with_settings, task,
            serial, parallel)
    from fabric.operations import (require, prompt, put, get, run, sudo, local,
        reboot, open_shell)
    from fabric.state import env, output
    from fabric.utils import abort, warn, puts, fastprint
    from fabric.tasks import execute

    总结:

    1、通过fabric,可以简单方便的部署一堆机器了

    2、fabric一般用env, sudo, put就够了

  • 相关阅读:
    07_Go语言 ( 切片)
    06_Go语言( 数组)
    05_Go语言( 流程控制)
    04_Go语言( 运算符)
    02_Go语言(变量和常量)
    01_Go语言(环境的搭建)
    云电脑直播简单指南
    统信UOS共享打印机配置
    #插头dp#洛谷 5074 Eat the Trees
    #状压dp#洛谷 3959 [NOIP2017 提高组] 宝藏
  • 原文地址:https://www.cnblogs.com/zapline/p/6508246.html
Copyright © 2020-2023  润新知