The main way in which you'll learn Ansible coding is by writing your own Ansible playbooks, either for fun or to solve your own infrastructure challenges. However, at a certain point, things may start to get complicated. Your code might be working, but how do you know if it is really doing the task in the right way? Is it efficient? How scalable will it be? Using meaningful names makes it easier to understand your code. Issues may also arise to do with script organization: it is easy to end up with a folder filled with several scripts, even if they have nothing to do with each other.
In this chapter, we're going to talk about the standards and best practices for writing Ansible playbooks. We are aiming to improve our playbooks by speeding up tasks, improving security, providing accommodation for built-in infrastructure...