ansible的三种安装方式

ansible的三种安装方式

   小樱     2019年9月10日 02:47     4038    

1、Pip安装

(1)安装python-pip python-devel

yum install python-pip python-devel -y

(2)安装Ansible服务

安装依赖的软件

yum install gcc glibc-devel zlib-devel rpm-build openssl-devel -y

(3)升级pip

pip install --upgrade pip

(4)安装

pip install ansible --upgrade

pip这种安装方式的话,是没有配置文件的,需要自己去创建,官网也有配置文件的内容。

https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg

mkdir /etc/ansible

touch ansible.cfg

ansible会自动去寻找配置文件。


2、编译安装(源码安装)

(1)从github上获取源码包

git clone https://github.com/ansible/ansible.git --recursive

(2)git下来的就是ansible的目录

cd ansible

(3)执行安装命令

source ./hacking/env-setup

 

3、yum安装

(1)将下列语句添加到yum源中

cat <<eof>>/etc/yum.repos.d/my.repo

[epel]
name=epel
baseurl=http://mirrors.aliyun.com/epel/7Server/x86_64/
enable=1
gpgcheck=0

eof

(2)直接用yum命令进行安装

yum install -y ansible

 

文章评论

0

其他文章