Deployment Method of Linux System Ansible Automation Operation and Maintenance

Time:2019-8-31

Ansible is an emerging automated operation and maintenance tool based on Python. It integrates the advantages of many old operation and maintenance tools to realize the functions of batch operating system configuration, batch program deployment, batch operation commands, etc. Here’s how to deploy them.

On the command line, extract the Ansible source code, git clone git://github.com/ansible/ansible.git — recursive as shown in the following figure

Enter the installation directory cd. / ansible and execute the installation source. / hacking / env-setup-q

If PIP has not been installed in the system, install PIP corresponding to the ptyhon version first:

easy_install pip

Python Module for Installing Ansible Controller

pip install paramiko PyYAML Jinja2  httplib2 six

When updating the Ansible version, not only the source tree of git, but also the module pointing to Ansible itself in git, called submodules, need to be updated.

Once you run the env-setup script, it means that Ansible can specify other locations by clearing the file inventory from the source code.

2. Yum Installation Mode (Centos7x64)

Install Yum extension source with RPM command: rpm-Uvh http://mirrors.zju.edu.cn/epel/7/x86_64/e/epel-release-7-7.noarch.rpm

Install with the yum command, yum-y install ansible