系统运维
ansible安装部署非常简单,只依赖于python和ssh,而这两个依赖默认都已经安装,我接触到的环境大部分是centos、redhat环境,也有少数ubuntu、suse这类系统,不过还是尽熟悉的来,在centos 操作系统安装ansible作为管理节点。
ansbile 底层也是基于python编写,所以通过pip方式可以安装ansible
步骤1:安装python-pip及pythondevel程序包
shell> yum install python-pip python-devel -y
步骤2:安装环境检查
//确保服务器安装了gcc glibc 等开发环境包
shell> yum install gcc glibc-devel zlib-devel rpm-build openssl-devel -y
//更新pip至最新版本
shell> pip install --upgrde pip
步骤3:安装ansible
shell> pip install ansible --upgrade
步骤4:查看安装的ansible版本
shell> ansible --version
ansible 2.7.10
注释:centos7.5 这个方法不一定能安装成功,因为python版本的问题,当你pip的时候,新版本的ansible会报错python过低。
如果对系统python 版本升级,那你会碰到好多的问题,推荐2个工具大家可以了解下,Pyenv / Virtualenv 多python环境扩展管理工具。
(1)添加yum源 选择阿里epel源
shell> rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm centos7
shell> rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm centos6
(2) yum 安装ansible
shell> yum -y install ansible
(1)添加ansible源
shell> apt-add-repository -y ppa:ansible/ansible
(2)安装ansible
shell> apt-get update
shell> apt-get install -y ansible
网页名称:(2)ansible安装部署
分享URL:https://www.cdcxhl.com/article0/cjjgio.html
成都网站建设公司_创新互联,为您提供网站维护、关键词优化、微信公众号、网站设计公司、建站公司、网站制作
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联