
Ansible 中文手册 -By Geekwolf http://www.simlinux.com
使用环境 Ubuntu 14.04.1 LTS
Control Machine: 192.168.0.4
Managed Nodes0: 192.168.0.5
192.168.0.6
注意:Ansible 默认使用 SSH 协议管理节点
安装要求:
控制服务器:需要安装 Python2.6/2.7
被管理服务器:需要安装 Python2.4 以上版本,若低于 Python2.5 需要安装 python-
simplejson; 若启用了 selinux,则需要安装 libselinux-python
方式一:源码安装
git clone git://github.com/ansible/ansible.git --recursive
cd ./ansible
source ./hacking/env-setup
sudo easy_install pip
sudo pip install paramiko PyYAML Jinja2 httplib2
Ansible 升级操作:
git pull --rebase
git submodule update --init --recursive
Git 知识请参考:
http://blog.csdn.net/huangyabin001/article/details/30100287
http://git-scm.com/docs/git-submodule
执行脚本 evn-setup 时会读取默认的主机清单文件/etc/ansible/hosts,主机清单文件路径可以通过环境
变量 ANSIBLE_HOSTS 设置或者执行 ansible 时-i 参数指定
最后可以执行 sudo make install 将 ansible 安装到 control server
问题 1:
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -
fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-x86_64-
2.7/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
解决办法:
评论