CentOS 7 源码安装Ansible 2.x
1、安装Python 3.x环境
[root@ansible ~]# yum install -y python36 python36-pip git [root@ansible ~]# ln -s /usr/bin/pip36 /usr/bin/pip3 [root@ansible ~]# pip install virtualenv
2、配置virtualenv环境(可选)
[deploy@ansible ~]$ useradd deploy && su - deploy [deploy@ansible ~]$ virtualenv -p /bin/python3. .py3-a2.-env [deploy@ansible ~]$ source .py3-a2.-env/bin/activate
3、从Github下载最新稳定版本代码
[root@localhost ~]# git clone -b stable-2.7 https://github.com/ansible/ansible.git
Cloning into 'ansible'...
remote: Enumerating objects: , done.
remote: Counting objects: % (/), done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 155.97 MiB | 4.54 MiB/s, done.
Resolving deltas: % (/), done.
4、安装ansible Python依赖包
[root@localhost ~]# pip3 install paramiko PyYAML jinja2
Collecting paramiko
Downloading https://files.pythonhosted.org/packages/cf/ae/94e70d49044ccc234bfdba20114fa947d7ba6eb68a2e452d89b920e62227/paramiko-2.4.2-py2.py3-none-any.whl (193kB)
% |████████████████████████████████| 194kB 976kB/s
Collecting PyYAML
Downloading https://files.pythonhosted.org/packages/9f/2c/9417b5c774792634834e730932745bc09a7d36754ca00acf1ccd1ac2594d/PyYAML-5.1.tar.gz (274kB)
% |████████████████████████████████| 276kB .2MB/s
Collecting jinja2
Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
% |████████████████████████████████| 133kB .3MB/s
Collecting pyasn1>=0.1. (from paramiko)
Downloading https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl (73kB)
% |████████████████████████████████| 81kB .8MB/s
Collecting bcrypt>=3.1. (from paramiko)
Downloading https://files.pythonhosted.org/packages/d0/79/79a4d167a31cc206117d9b396926615fa9c1fdbd52017bcced80937ac501/bcrypt-3.1.6-cp34-abi3-manylinux1_x86_64.whl (55kB)
% |████████████████████████████████| 61kB .6MB/s
Collecting cryptography>=1.5 (from paramiko)
Downloading https://files.pythonhosted.org/packages/5b/12/b0409a94dad366d98a8eee2a77678c7a73aafd8c0e4b835abea634ea3896/cryptography-2.6.1-cp34-abi3-manylinux1_x86_64.whl (2.3MB)
% |████████████████████████████████| .3MB 506kB/s
Collecting pynacl>=1.0. (from paramiko)
Downloading https://files.pythonhosted.org/packages/27/15/2cd0a203f318c2240b42cd9dd13c931ddd61067809fee3479f44f086103e/PyNaCl-1.3.0-cp34-abi3-manylinux1_x86_64.whl (759kB)
% |████████████████████████████████| 768kB .6MB/s
Collecting MarkupSafe>=0.23 (from jinja2)
Downloading https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting cffi>=1.1 (from bcrypt>=3.1.->paramiko)
Downloading https://files.pythonhosted.org/packages/20/f7/87b62a8895bf7c93e907b05b97bc4459c81a38a61151f03a6eae13d863aa/cffi-1.12.2-cp36-cp36m-manylinux1_x86_64.whl (428kB)
% |████████████████████████████████| 430kB .0MB/s
Collecting six>=1.4. (from bcrypt>=3.1.->paramiko)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21. (from cryptography>=1.5->paramiko)
Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
% |████████████████████████████████| 102kB .6MB/s
Collecting pycparser (from cffi>=1.1->bcrypt>=3.1.->paramiko)
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
% |████████████████████████████████| 163kB .5MB/s
Installing collected packages: pyasn1, pycparser, cffi, six, bcrypt, asn1crypto, cryptography, pynacl, paramiko, PyYAML, MarkupSafe, jinja2
Running setup.py install for pycparser ... done
Running setup.py install for PyYAML ... done
Successfully installed MarkupSafe-1.1. PyYAML-5.1 asn1crypto-0.24. bcrypt-3.1. cffi-1.12. cryptography-2.6. jinja2-2.10. paramiko-2.4. pyasn1-0.4. pycparser-2.19 pynacl-1.3. six-1.12.
You are using pip version 9.0., however version 19.0. is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
5、安装ansible
[root@localhost ~]# ls
ansible [root@localhost ~]# cd ansible/ [root@localhost ansible]# ls
bin contrib docsite_requirements.txt lib MANIFEST.in README.rst shippable.yml
changelogs COPYING examples licenses MODULE_GUIDELINES.md requirements.txt test
CODING_GUIDELINES.md docs hacking Makefile packaging setup.py tox.ini [root@localhost ansible]# python3 setup.py install
running install
running bdist_egg
running egg_info
creating lib/ansible.egg-info
writing lib/ansible.egg-info/PKG-INFO
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing requirements to lib/ansible.egg-info/requires.txt
writing top-level names to lib/ansible.egg-info/top_level.txt
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'SYMLINK_CACHE.json'
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
.
.
此处省略几百行
.
.
Using /usr/local/lib/python3./site-packages
Finished processing dependencies for ansible==2.7..post0
6、创建Ansible配置文件,并开启Ansible日志(Ansible默认不启用日志)
[root@localhost ~]# mkdir /etc/ansible
[root@localhost ~]# cp ansible/examples/ansible.cfg /etc/ansible/
[root@localhost ~]# sed -i 's/#log_path/log_path/' /etc/ansible/ansible.cfg
7、验证Ansible安装结果
[root@localhost ansible]# ansible --version
ansible 2.7..post0
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3./site-packages/ansible-2.7..post0-py3..egg/ansible
executable location = /usr/local/bin/ansible
python version = 3.6. (default, Apr , ::) [GCC 4.8. (Red Hat 4.8.-)]
CentOS 7 源码安装Ansible 2.x的更多相关文章
- CentOS下源码安装Apache2.4+PHP5.4+MySQL5.5
一.准备(把所有的源文件放在‘/home/yuanjun’目录下) apr http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz apr-util ...
- 源码安装Ansible
一.Ansible介绍 ansible是一款的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef.func.fabric)的优点,实现了批量系统配置.批 ...
- Linux 源码安装Ansible 参考篇
Ansible 源码搭建配置 近期在学习自动化运维相关技术,文章主要模拟内网情况下对Ansible的安装演示,源码安装较为繁琐.枯燥,尤其是在实际安装过程中可能出现各式各样的问题,所有在安装过程中尽量 ...
- CentOS下源码安装vsftpd-3.0.0,并设置指定用户访问指定目录(附带完整配置文件)
1.卸载系统已经存在的ftp服务器 因为是源码安装,所以不能通过rpm -qa的方式查看是否已经安装ftp服务器,可以通过find / | grep vsftp*方式查看系统中存在哪些与vsftpd相 ...
- 在 CentOS 下源码安装 Xen
http://www.vpsee.com/2010/04/install-xen-on-centos-from-source/ 在 CentOS 源码编译安装 Xen 的过程和在 Debian 上编译 ...
- Centos下源码安装git
1.centos下git版本太久了,才1.8几,而官方更新的还是很活跃的,于是我就想源码安装一个新版本. 2.首先到: https://github.com/git/git/releases 下载最新 ...
- centos上源码安装clang 3.8
之前想在centos系统上安装clang 3.6版本,由于yum上版本太低,想通过源码编译安装.按照网上说的源码安装步骤,下好llvm.clang.clang-tools-extra和compiler ...
- centos环境源码安装postgresql9.4
源码安装简要步骤 下载PostgreSQL 源码包 下载根目录地址:http://ftp.postgresql.org/ 本人选择的是当前最新版本v9.4.1:http://ftp.postgre ...
- centos 7 源码安装gogs
gogs 是轻量级的私有git 平台,允许个人通过低配置的服务器安装私有git gogs 的官网地址是:https://gogs.io/ 安装步骤 1)源码安装mysql 2) 源码安装git 3) ...
随机推荐
- UIActionSheet样式问题心得
下午在做一个iPad的项目,需要用到一个 UIActionSheet. 点击popView中的“sort”按钮,触发出一个ActionSheet. self.action = [[[UIActionS ...
- 赢在面试之Java多线程(十一)
121,什么是线程? 线程是操作系统能够进行运算调度的最小单位,它被包含在进程之中,是进程中的实际运作单位.程序员可以通过它进行多处理器编程,你可以使用多线程对运算密集型任务提速.比如,如果一个线程完 ...
- EXCEL自动导出HTML
话说博主我以前总是为资料共享的问题发愁,刚才鼓捣了一下EXCEL.发现有个功能还是不错的'发布' 以OFFICE2013为标准吧. 点击文件--导出-- 更改文件类型---另存为--(网页)htm 点 ...
- bootstrap-table固定表头固定列
1.引入 bootstrap依赖于jquery bootstrap-table依赖于bootstrap,所以都需要引入 2. bootstrap-table有两种方式,html.js <tabl ...
- Java中native关键字使用
native是与C++异构开发的时候用的.java自己开发不会使用
- 转!! Eclipse设定和修改文件字符编码格式和换行符
Window -> Preferences -> General -> Workspace : Text file encoding :Default : 选择此项将设定文件为系统默 ...
- django模板复用 extends,block,include
template复用 extends block include render 参考:https://code.ziqiangxuetang.com/django/django-template.ht ...
- 如何实现redis集群?
由于Redis出众的性能,其在众多的移动互联网企业中得到广泛的应用.Redis在3.0版本前只支持单实例模式,虽然现在的服务器内存可以到100GB.200GB的规模,但是单实例模式限制了Redis没法 ...
- eclipse或Myeclipse中web项目没有run on server时怎么办?
文章转载至:http://blog.csdn.net/hongchangfirst/article/details/7722703 web项目没有run on server 1.首先确保正确安装Tom ...
- 初级学IP地址
IP地址是我们上网的凭证!通过IP地址的学习.能够对网络拓扑结构有一个简单的认识,以及对网络的传递过程进行初步了解. 传输数据简单认识 网络中传播的数据是以数据包的形式存在的! 当中包括着目的IP地址 ...