Fabric源码安装

参考:https://jingyan.baidu.com/article/fedf0737a6877935ad897746.html

1.

fabric是轻量级自动化管理工具,使用起来也很方便。fabirc依赖一些模块必须先安装好,对python版本的要求最低是2.6.6。实验环境是centos6.5_x64

2.工具

  • gmp-6.1.1.tar.bz2 (系统已安装,gmp-6.0.0-15.el7.x86_64,就没再安装)
  • setuptools-28.7.1.tar.gz  (系统已安装,python-setuptools-0.9.8-7.el7.noarch,就没再安装)
  • pycrypto-2.6.1.tar.gz
  • paramiko-1.15.1.tar.gz
  • ecdsa-0.13.tar.gz
  • Fabric-1.8.2.tar.gz
3.记录下

安装gmp

tar -xvjpf gmp-6.1.1.tar.bz2

cd gmp-6.1.1

./configure

make

make check 

make install


安装setuptools

tar zxvf setuptools-28.7.1.tar.gz 

cd setuptools-28.7.1

python setup.py build & python setup.py install


安装pycrypto

tar zxvf pycrypto-2.6.1.tar.gz 

cd pycrypto-2.6.1

python setup.py build & python setup.py install


安装Paramiko

tar zxvf paramiko-1.15.1.tar.gz

cd paramiko-1.15.1

python setup.py build & python setup.py install


安装ecdsa

tar zxvf ecdsa-0.13.tar.gz 

cd ecdsa-0.13

python setup.py build & python setup.py install


安装fabric

tar zxvf Fabric-1.8.2.tar.gz 

cd Fabric-1.8.2

python setup.py build & python setup.py install


测试

[root@master ~]# python -c "from fabric.api import * ; print env.version"
1.8.2
[root@master ~]# 

查看fab命令

[root@master ~]# fab
Usage: fab [options] <command>[:arg1,arg2=val2,host=foo,hosts='h1;h2',...] ...


Options:
  -h, --help            show this help message and exit
  -d NAME, --display=NAME
                        print detailed info about command NAME
  -F FORMAT, --list-format=FORMAT
                        formats --list, choices: short, normal, nested
  -I, --initial-password-prompt
                        Force password prompt up-front
  -l, --list            print list of possible commands and exit
  --set=KEY=VALUE,...   comma separated KEY=VALUE pairs to set Fab env vars
  --shortlist           alias for -F short --list
  -V, --version         show program's version number and exit
  -a, --no_agent        don't use the running SSH agent
  -A, --forward-agent   forward local agent to remote end
  --abort-on-prompts    abort instead of prompting (for password, host, etc)
  -c PATH, --config=PATH
                        specify location of config file to use
  --colorize-errors     Color error output
  -D, --disable-known-hosts
                        do not load user known_hosts file
  -e, --eagerly-disconnect
                        disconnect from hosts as soon as possible
  -f PATH, --fabfile=PATH
                        python module file to import, e.g. '../other.py'
  -g HOST, --gateway=HOST
                        gateway host to connect through
  --hide=LEVELS         comma-separated list of output levels to hide
  -H HOSTS, --hosts=HOSTS
                        comma-separated list of hosts to operate on
  -i PATH               path to SSH private key file. May be repeated.
  -k, --no-keys         don't load private key files from ~/.ssh/
  --keepalive=N         enables a keepalive every N seconds
  --linewise            print line-by-line instead of byte-by-byte
  -n M, --connection-attempts=M
                        make M attempts to connect before giving up
  --no-pty              do not use pseudo-terminal in run/sudo
  -p PASSWORD, --password=PASSWORD
                        password for use with authentication and/or sudo
  -P, --parallel        default to parallel execution method
  --port=PORT           SSH connection port
  -r, --reject-unknown-hosts
                        reject unknown hosts
  --system-known-hosts=SYSTEM_KNOWN_HOSTS
                        load system known_hosts file before reading user
                        known_hosts
  -R ROLES, --roles=ROLES
                        comma-separated list of roles to operate on
  -s SHELL, --shell=SHELL
                        specify a new shell, defaults to '/bin/bash -l -c'
  --show=LEVELS         comma-separated list of output levels to show
  --skip-bad-hosts      skip over hosts that can't be reached
  --ssh-config-path=PATH
                        Path to SSH config file
  -t N, --timeout=N     set connection timeout to N seconds
  -T N, --command-timeout=N
                        set remote command timeout to N seconds
  -u USER, --user=USER  username to use when connecting to remote hosts
  -w, --warn-only       warn, instead of abort, when commands fail
  -x HOSTS, --exclude-hosts=HOSTS
                        comma-separated list of hosts to exclude
  -z INT, --pool-size=INT
                        number of concurrent processes to use in parallel mode
[root@master ~]# 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值