ansible-Batch Linux management tools

Source: Internet
Author: User
Tags git clone

From http://blog.chinaunix.net/uid-20642150-id-4096719.html

ansible-Batch Linux management tools

Https://github.com/ansible/ansible
Inadvertently see this project, feel very similar to puppet, take the time to understand, found is very good, and support the use of Python to add their own modules, very simple.
and relatively speaking, Ansible has the following advantages:
1, lightweight, he does not need to go to the client Installation Agent, update, only need to perform an update on the operator machine
2, bulk task execution can be written as a script, and can be executed without distributing to remote
3, the use of Python written, maintenance is simpler, ruby syntax is too complex
4. Support sudo

Disadvantages:
1, for thousands of units, tens of thousands of machine operation, still do not know the performance, efficiency, need to know more about the situation.

Here's how to use it briefly:
Ansible installation on CentOS 6.2


Source installation, source code to github download can
Yum Install pyyaml.x86_64 Python-paramiko.noarch python-jinja2.x86_64
Python setup.py Build
Python setup.py Install


RPM Installation
git clone git://github.com/ansible/ansible.git
CD./ansible
Make rpm
sudo rpm-uvh ~/rpmbuild/ansible-*.noarch.rpm

Add the following environment variables below the/etc/profile
Export Ansible_hosts=/etc/ansible/ansible_hosts
Export Ansible_config=/etc/ansible/ansible.cfg
Where/etc/ansible/ansible_hosts inside is the list of hosts to operate, of course, when executing the command, you can also take the "-i" parameter to specify the host list file name


Ansible all-m command-a "/bin/echo Hello"--ask-pass
Ansible all-m Ping--ask-pass-u root
Ansible all-m script-a "/root/hequan/shell/t.sh"-K
Ansible all-m copy-a "src=/root/hequan/shell/t.sh dest=/tmp/mode=755 owner=root group=root"-k-u root
Ansible all-m file-a "dest=/tmp/t.sh mode=755 owner=root group=root"-k-u root
Ansible all-i/etc/ansible/serverlist-m shell-a "/tmp/t.sh"-k-u root
Ansible all-m user-a "Name=foo password="
Ansible all-m user-a "Name=foo state=absent"


Performance does not know how, follow the script to do the stress test.

ansible-Batch Linux management tools

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.