(2) ansible installation and deployment
Ansible installation and deployment is very simple, only rely on python and ssh, and these two dependencies are installed by default. Most of the environments I have come into contact with are centos and redhat environments, and there are also a few systems such as ubuntu and suse. However, I am familiar with installing ansible as a management node in the centos operating system.
1. Pip installation
The bottom layer of ansbile is also written on python, so you can install ansible through pip.
Step 1: install the python-pip and pythondevel packages
Shell > yum install python-pip python-devel-y
Step 2: check the installation environment
/ / make sure that development environment packages such as gcc glibc are installed on the server
Shell > yum install gcc glibc-devel zlib-devel rpm-build openssl-devel-y
/ / Update pip to the latest version
Shell > pip install-- upgrde pip
Step 3: install ansible
Shell > pip install ansible-- upgrade
Step 4: view the installed version of ansible
Shell > ansible-- version
Ansible 2.7.10
Note: the centos7.5 method may not be installed successfully because of the problem with the python version, when you pip, the new version of ansible will report that the python is too low.
If the system python version upgrade, then you will encounter a lot of problems, recommend 2 tools you can understand, Pyenv / Virtualenv multi-python environment extension management tools.
II. Yum installation
(1) add yum source and select Ali epel source
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 installs ansible
Shell > yum-y install ansible
III. Apt-get installation
(1) add ansible source
Shell > apt-add-repository-y ppa:ansible/ansible
(2) install ansible
Shell > apt-get update
Shell > apt-get install-y ansible