Working With Playbooks

Working With Playbooks

使用playbook

Playbooks are Ansible’s configuration, deployment, and orchestration language. They can describe a policy you want your remote systems to enforce, or a set of steps in a general IT process.

Playbooks是Ansible的配置,部署和编排语言。他们可以描述您希望远程系统实施的策略,或者描述一般IT流程中的一系列步骤。

If Ansible modules are the tools in your workshop, playbooks are your instruction manuals, and your inventory of hosts are your raw material.

如果Ansible模块是您工作场景中的工具,那么Playbook就是您的使用说明书,而您的主机库存就是您的原材料。

At a basic level, playbooks can be used to manage configurations of and deployments to remote machines. At a more advanced level, they can sequence multi-tier rollouts involving rolling updates, and can delegate actions to other hosts, interacting with monitoring servers and load balancers along the way.

在基础级别,可以使用playbooks来管理远程计算机的配置和部署。在更高级别,他们可以对涉及滚动更新的多层部署进行排序,并可以将操作委派给其他主机,并在此过程中与监控服务器和负载平衡器进行交互。

While there’s a lot of information here, there’s no need to learn everything at once. You can start small and pick up more features over time as you need them.

虽然这里有很多信息,但没有必要一次学习所有内容。您可以从小处着手,随时根据需要选择更多功能。

Playbooks are designed to be human-readable and are developed in a basic text language. There are multiple ways to organize playbooks and the files they include, and we’ll offer up some suggestions on that and making the most out of Ansible.

Playbooks设计为人类可读的,并以基本文本语言开发。有多种方法来组织Playbooks及其中包含的文件,我们将提供一些建议使你可以充分利用Ansible。

You should look at Example Playbooks while reading along with the playbook documentation. These illustrate best practices as well as how to put many of the various concepts together.

您应该在阅读Playbook文档的同时查看示例Playbooks这些说明了最佳实践以及如何将许多不同的概念放在一起。

Creating Reusable Playbooks

Variables

Blocks

Advanced Playbooks Features

Strategies

Best Practices

https://docs.ansible.com/ansible/latest/user_guide/playbooks.html

原文地址:https://www.cnblogs.com/cevinchen/p/9539566.html