2021 总结：学习 Ansible 的 9 种方法
Ansible

> 
> Ansible 是一个开源的自动化工具，可以以多种方式使用。以下是几个去年最受欢迎的 Ansible 教程和故事。
> 
> 
> 


![](/data/attachment/album/202201/16/083241cliohvo1ii1nutig.jpg "young woman working on a laptop")


自动化不断改善着 IT 团队中每个人的生活。Ansible 可以帮助任何使用 IT 自动化的人，不管是为了保持文件的有序性还是配置打印机，或者是为了任何其他可以想象和构建的东西。这些是 2021 年我们分享的一些最引人注目的使用案例和经验。


无论你是第一次听说 Ansible，还是一个经验丰富的用户，这些文章都会有你的收获。


* Ansible 的创始人 Michael DeHaan 分享了他对自己如何被引向 IT 自动化的想法。这篇访谈对 [Ansible 是如何诞生的](https://opensource.com/article/21/2/ansible-origin-story) 以及随着时间的推移而发展的信息和见解都非常好。
* 当你作为一个系统管理员可以将许多日常任务自动化时，自动化可以节省一天的时间。了解如何使用 Ansible 为 [五个日常的系统管理员任务](https://opensource.com/article/21/3/ansible-sysadmin) 实现自动化流程。
* 你的下载文件夹中充满了垃圾吗？介绍一个简单的方法，用一个简单的剧本来清理你系统上的文件。它很容易扩展，计划好后，就会按照你的要求频繁运行。了解更多关于 [用 Ansible 删除文件](https://opensource.com/article/21/9/keep-folders-tidy-ansible)。
* 如果你正在 [写 Ansible 剧本](https://opensource.com/article/21/1/improve-ansible-play)，可以用四行代码改善它们。想想下一个用户，特别是当你在一个项目上合作的时候。一个小的努力可以防止大的问题。
* Ansible 社区已经采取了措施，通过审查其代码库和更新语言，使该项目更具包容性。请看 [Ansible 术语变化](https://opensource.com/article/21/5/inclusive-language-ansible) 的总结。
* 从你的 Ansible 剧本中调用 API，就像一个专业人员一样！找出每个人都应该知道的关于 [利用剧本中的 REST API](https://opensource.com/article/21/9/ansible-rest-apis)。
* 有一些应该每天、每周或每月运行的计划任务？使用 [Ansible 和 anacron](https://opensource.com/article/21/9/ansible-anacron-automation) 来设置任务，利用时间戳而不是计划时间，所以即使你的机器在计划时间关闭，它也会在重新开启时运行。
* 如果你刚刚开始使用 Ansible，也许你需要一些方向来开始。这里有 [每个人都可以使用 Ansible 的 10 种方法](https://opensource.com/article/21/1/ansible)。
* 当社区一起工作时，奇迹就会发生。这不仅仅是代码：了解 [Ansible 如何构建设计系统](https://opensource.com/article/21/4/ansible-community-logos)，创建可重用的品牌资产以供社区使用。如果你是设计师或社区经理，你会特别欣赏这个故事。




---


via: <https://opensource.com/article/22/1/learn-ansible>


作者：[Sumantro Mukherjee](https://opensource.com/users/sumantro) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Automation just keeps improving the lives of everyone on the IT team. Ansible helps anyone who uses IT automation, whether for keeping files organized or configuring printers, or for anything else someone can imagine and build. These are some of the most notable use cases and experiences shared on Opensource.com in 2021.


If you are hearing about Ansible for the first time, or if you're a seasoned user, these articles will have something for you.

-
Michael DeHaan, the founder of Ansible, shares his thoughts on how he was led to IT automation. This interview has great information and insights into

[how Ansible came into existence](https://opensource.com/article/21/2/ansible-origin-story)and developed over time. -
Automation saves the day when you can automate many of your daily tasks as a sysadmin. Learn how to implement automated processes for

[five everyday sysadmin tasks](https://opensource.com/article/21/3/ansible-sysadmin)using Ansible. -
Is your Downloads folder full of junk? Introducing a simple way to clean up files on your system with a simple playbook. It scales easily, and once scheduled it will run as frequently as you ask. Learn more about

[removing files with Ansible](https://opensource.com/article/21/9/keep-folders-tidy-ansible). -
If you're

[writing Ansible playbooks](https://opensource.com/article/21/1/improve-ansible-play), four lines of code can improve them. Think about the next user, especially when you are collaborating on a project. A small effort can prevent big problems. -
The Ansible community has taken steps to make the project more inclusive by reviewing its codebase and updating its language. See a summary of the

[Ansible terminology changes](https://opensource.com/article/21/5/inclusive-language-ansible). -
Call APIs from your Ansible playbook like a pro! Find out something everyone should know about

[leveraging REST APIs from a playbook](https://opensource.com/article/21/9/ansible-rest-apis). -
Have some CronJobs that should run daily, weekly, or monthly? Use

[Ansible and anacron](https://opensource.com/article/21/9/ansible-anacron-automation)to set tasks to leverage timestamps instead of scheduled time, so even if your machine is off at the scheduled time, it will run when it's back on. -
If you are just getting started with Ansible, maybe you want some direction on where to begin. Here are

[10 ways everyone can use Ansible](https://opensource.com/article/21/1/ansible). -
Magic happens when a community works together. It's not just code: learn

[how Ansible built a design system](https://opensource.com/article/21/4/ansible-community-logos), creating reusable brand assets for community use. You'll especially appreciate this story if you are a designer or community manager.

## Comments are closed.