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) ...
随机推荐
- js获取上个月的第一天和最后一天
var now = new Date(); var fd = new Date(now.getFullYear(), now.getMonth()-1 ,1).toLocaleDateString() ...
- iOS 修改状态栏颜色
1.首先,苹果把UIViewControllerBasedStatusBarAppearance默认的值设为YES,是有他的道理的,新系统下,苹果希望我们的viewcontroller去控制statu ...
- Leetcode-Test Justification
Given an array of words and a length L, format the text such that each line has exactly L characters ...
- react 坑总结
1.react可以在里面直接更改state的变量 例如: 2.react 数组循环
- Storm-源码分析-Topology Submit-Task
mk-task, 比较简单, 因为task只是概念上的结构, 不象其他worker, executor都需要创建进程或线程 所以其核心其实就是mk-task-data, 1. 创建TopologyCo ...
- Oracle 11g修改字符集AL32UTF8为ZHS16GBK
oracle11g更改字符集AL32UTF8为ZHS16GBK当初安装oracle的时候选择的默认安装,结果字符集不是以前经常用的16GBK,要改字符集,从网上找到了方法并试了一下,果然好用! 具体如 ...
- 利用VMware克隆linux虚拟机需要注意的事项
利用VMware克隆虚拟机需要注意的问题 2018年03月30日 18:20:29 温文尔雅的流氓 阅读数:1343更多 个人分类: linux 版权声明:本文为博主原创文章,未经博主允许不得转载 ...
- IntelliJ创建main函数、for循环,System.out.println()等快捷建(转载)
在编写代码的时候直接输入psv就会看到一个psvm的提示,此时点击tab键一个main方法就写好了. psvm 也就是public static void main的首字母. 依次还有在方法体内键入f ...
- C# 调用win api获取chrome浏览器中地址
//FindWindow 查找窗口 //FindWindowEx查找子窗口 //EnumWindows列举屏幕上的所有顶层窗口,如果回调函数成功则返回非零,失败则返回零 //GetWindowText ...
- Tornado模块分类
Tornado模块分类 1. Core web framework tornado.web — 包含web框架的大部分主要功能,包含RequestHandler和Application两个重要的类 t ...