SaltStack开发环境搭建
安装及准备
切换到python独立环境
1 | $ pyenv virtualenv salt-2.7.8 |
获取代码:
1 | $ git clone https://github.com/saltstack/salt |
安装:
1 | $ env SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" pip install M2Crypto |
配置:
1 | $ mkdir -p $(dirname `pyenv which python`)/../etc/salt $ cp ./salt/conf/master ./salt/conf/minion $(dirname `pyenv which python`)/../etc/salt |
master配置文件:
- user: root
- root_dir: $(dirname
pyenv which python
)/.. - pidfile: $(dirname
pyenv which python
)/../salt-master.pid - publish_port: 14505
- ret_port: 14506
minion配置文件:
- user: root
- root_dir: $(dirname
pyenv which python
)/.. - pidfile: $(dirname
pyenv which python
)/../salt-minion.pid - master: localhost
- id: saltdev
- master_port: 14505
运行启动:
1 | $ cd $(dirname `pyenv which python`)/../ |
其他:
- 通过
-l debug
开启debug模式,去掉-d
直接输出到console。 - socket path在linux上最多107个字符,可以通过缩短sock_dir和root_dir字符。
ulimit -n
检查File descriptor limites,至少2047:ulimit -n 2048
文档生成
1 | $ pip install Sphinx==1.3b2 |
Tests
1 | $ ./setup.py test |