Ansible-Bulk Linux management tools

Source: Internet
Author: User

Ansible-Bulk Linux management tools

"Ansible is easy it Automation"--simple automated IT tools.

    • Batch execution of commands on a remote server
    • Automating the deployment of apps
    • Automation Management Configuration Items
    • Automated Cloud service Management
Install (Ubuntu)

Rely on SSH and python

Apt-get Install Ansible

Configuration file

Ensure that the managed server can use the 密钥认证 login
The default path can be specified by modifying the hostfile parameter of the ANSIBLE.CFG

Vim/etc/ansible/hosts

Use

Time to view all servers

Ansible all-a "Date"

Modules for Ansible

Ansible to do some remote management work in a modular way
All modules can be viewed via ansible-doc-l
You can use the Ansible-doc-s module to view more detailed information about the module

PlayBook

Batch execution of a set of tasks by reading a configured file, with a YAML syntax structure for the configuration file

Composition of the PlayBook

Defines the playbook that will be executed. 远程主机组
Define playbook allow is required for 变量 use
Defines what will be performed on the remote host. 任务列表
Defines what needs to be called after the task execution completes.回调任务

Examples of PLAYBOOK.YML
- hosts: webserversvars:    http_port: 80    max_clients: 200remote_user: roottasks:- name: ensure apache is at the latest version    yum: pkg=httpd state=latest- name: write the apache config file    template: src=/srv/httpd.j2 dest=/etc/httpd.conf    notify:    - restart apache
Run Playbook

Ansible-playbook PLAYBOOK.YML-F10

Related Help
    • Learning Video: http://edu.51cto.com/course/course_id-2220.html

Ansible-Bulk 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.