Ansible Study Notes 7-playbooks implementation of a playbook

Source: Internet
Author: User
Tags ansible playbook

Perform a playbook


The above sections already have a preliminary understanding of Playbook's syntax, so how do you run a playbook?

This is very simple, here's an example of running playbook in parallel, the level of parallelism is 10


Ansible-playbook Playbook.yml-f 10


Ansible-pull (pull configuration rather than push configuration)

Can we turn the ansible architecture upside down so that the managed node

Do check in to get configuration information instead of pushing configuration information to all managed nodes? Yes, I can.


Ansible-pull is a small script that checkout a repo about configuration instructions from Git.

Then run the Ansible-playbook with this configuration command.


Assuming you load-balance your checkout location, Ansible-pull can basically be infinitely

Increase scale


Executable Ansible-pull--help for detailed help information


There is also a thing called Clever playbook: clever playbook. This can be done by crontab.

To configure Ansible-pull


Tips and Tricks

At the bottom of the Playbook execution output information, you can find information about the managed node. You can also see general failure information, and serious "unreachable" information. The two are counted separately.


If you want to see the output of a successful modules, use--verbose flag (otherwise only the output information will fail to execute). This is available in 0.5 and later versions.


If the Cowsay software package is installed, the output of Ansible playbook has been extensively upgraded. You can try it!


Before executing a playbook, to see which hosts the playbook execution will affect, you can do this:


Ansible-playbook playbook.yml--list-hosts




This article from "Eight Miles" blog, declined reprint!

Ansible Study Notes 7-playbooks implementation of a playbook

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.