gitlab+jenkins+maven+docker持續集成(九)——centos7 ansible安裝及問題彙總

centos7最小化安裝ansibles

1、error: cffi 1.6.0 is installed but cffi>=1.7 is required by set(['cryptography'])


yum remove -y python-cffi
pip install cffi>=1.8.0


2、easy_install command not found


wget https://bootstrap.pypa.io/ez_setup.py -O - | python


安裝ansible 

#easy_install simplejson

#easy_install pip

#yum install gcc python-devel

#easy_install ansible


ansible驗證安裝


設置無密碼ssh訪問遠程主機:

#ssh-keygen -t rsa
#ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

創建ansible主機列表:

默認路徑 /etc/ansible/hosts  主機列表可以是靜態配置文件,可通過 -i 選項指定。


#mkdir /etc/ansibles
# vi /etc/ansible/hosts
[test]
192.168.10.24

測試遠程主機的運行狀態

# ansible test -m ping
192.168.10.24 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章