步驟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環境擴展管理工具。

二、yum 安裝

(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

三、 apt-get 安裝

(1)添加ansible源
shell> apt-add-repository -y ppa:ansible/ansible
(2)安裝ansible
shell> apt-get update
shell> apt-get install -y ansible

更多關于云服務器域名注冊,虛擬主機的問題,請訪問三五互聯官網:www.shinetop.cn

贊(0)
聲明:本網站發布的內容(圖片、視頻和文字)以原創、轉載和分享網絡內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。郵箱:3140448839@qq.com。本站原創內容未經允許不得轉載,或轉載時需注明出處:三五互聯知識庫 » (2)ansible 安裝部署

登錄

找回密碼

注冊