Enterprise-level automated O & M deployment in CentOS 6.5-Ansible

Source: Internet
Author: User
Tags ansible template

Enterprise-level automated O & M deployment in CentOS 6.5-Ansible

I. Introduction to Ansible
Ansible is very different from some other project management tools on the market. It was designed to facilitate and quickly manage configurations. It is easy to install and use, and the syntax is also very easy to learn. You can use Ansible to simplify and standardize complex configurations.
Ansible only needs to run on a common server, and does not need to install the client on the managed server. Because it is based on SSH, Linux servers cannot do without SSH, so Ansible does not need to add additional support for configuration work. You can use Ansible through the command line. The server running Ansible is commonly known as "Management node". The server managed through Ansible is also known as "Controlled node ".
Ansible is an extremely flexible open-source tool suite that greatly simplifies the automated configuration management and process control methods of Unix administrators. It uses the push method to configure the customer system so that all work can be done on the master server side. Its command line mechanism is also very powerful, allowing you to use commercial license Web UI for authorization management and configuration.


Ansible is developed in Python. Currently, Ansible users include evernote, rackspace, NASA, Atlassian, and twitter.
Ansible aims to be the simplest and easiest to operate. It also focuses on security and reliability, streamlining, the use of OpenSSH transmission (with an accelerated Socket mode and push mode as an alternative) and the ease of syntax.
Ansible can manage a small network environment or an enterprise-level network environment with thousands of people. It can easily complete your tasks.
You do not need to install the agent client program on the Ansible management machine. This means that Ansible management does not have problems with upgrading remote proxy client programs or managing the system. Ansible uses OpenSSH, an open-source component, to communicate with remote machines. Ansible uses decentralized management, which relies on your system creden。 to control and access machines. Of course, you can also use Kerberos, LDAP, and other centralized authentication management systems to easily complete the connection if needed.
Ansible advantages:

Lightweight, you do not need to install the agent on the client. when updating the agent, you only need to perform an update on the operating machine and use the SSH protocol.

Batch task execution can be written as scripts, and can be executed without being distributed remotely.

Written in python to simplify maintenance.

Supports sudo common user commands.

2. Install ansible

Ansible manages machines through the SSH protocol by default. After Ansible is installed, you do not need to configure a database for it. Ansible does not start or maintain the running status in daemons mode. You only need to install Ansible on one machine, and it can manage all the remote machines just like the central server.
Ansible installation version Selection: if you are using RedHat Enterprise Linux (TM), CentOS, Fedora, Debian or Ubuntu, and want to use the final version of Ansible, we strongly recommend that you use the OS Package Manager to install Ansible, such as CentOS YUM and Debian apt.
If you are using another system, we recommend that you use PIP ". Pip is a Python package installation and management tool with functions similar to Node. js npm and Ruby gem. Using pip, you can easily install, upgrade, and delete Python packages.

1. Install Ansible

Installing ansible on CentOS 6.5

Ansible can be installed on Linux, BSD, Mac OS X, and other platforms. The minimum Python version requirement is 2.6.
CentOS can be directly installed using yum. Install the epel source code before installation.

1) install EPEL
32-bit System Selection:
# Rpm-ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
64-bit System Selection:
# Rpm-ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2) install ansible
# Yum install-y ansible
Installing ansible on Debian 7.4

# Apt-get install-y build-essential

# Apt-get install python-dev python-yamlpython-paramiko python-jinja2 git

# Wget; tar ansible-1.9.2.tar.gz; cd ansible-1.9.2 & make install

# Whereis ansible

Ansible:/etc/ansible/usr/local/bin/ansible/usr/share/ansible

###/Usr/share/ansible template path

# Mkdir/etc/ansible

# Ansible-1.9.2/examples/ansible. cfg/etc/ansible
# Ansible-1.9.2/examples/ansible. cfg/etc/ansible

PIP Installation

Install Ansible Through pip (for more details about pip, visit the https://pypi.Python.org/pypi/pip)

Requirements for installing the Ansibl Central Control Server:
Python version: Python> = 2.6
Linux: RedHat, Debian, CentOS, OS X, BSDS, and so on (Windows is not supported currently)
Requirements for managed node servers:
Python version: Python> = 2.4
Linux: RedHat, Debian, CentOS, OS X, BSDS, and so on (Windows is not supported currently)
Note:

If Python running on a remote machine is smaller than Python2.5, you need to install Python-simplejson.
If SELinux is enabled on a remote machine, you also need to install libselinux-Python.

# Yum-y install Python-setuptools // install pip

# Pip install ansbile // install ansible

Source code Installation
# Git clone https://github.com/ansible/ansible.git
# Cd/usr/local/src; wget https://pypi.python.org/packages/source/a/ansible/ansible-1.9.2.tar.gz; tar zxvf ansible-1.9.2.tar.gz; cd ansible & make install
# Whereis ansible
Ansible:/etc/ansible/usr/local/bin/ansible/usr/share/ansible
#/Usr/share/ansible template path

# Mkdir/etc/ansible
# Ansible-1.5/examples/ansible. cfg/etc/ansible/

Use Ansible to efficiently deliver Docker containers

Batch manage remote servers using Ansible

Ansible installation configuration and simple use

Install and use the automation tool Ansible in CentOS 7

Functions and usage of Ansible and Docker

Ansible batch build LAMP Environment

Ansible: a configuration management and IT automation tool

Ansible details: click here
Ansible: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.