In this recipe, we will outline how to validate YAML files and Ansible playbooks using the Yamllint and ansible-lint tools, in order to make sure that our YAML documents are valid with the correct syntax, as well as validating our Ansible playbooks.
Validating YAML and Ansible playbooks
Getting ready
Python and PIP package manager must be already installed on your Linux machine, and Ansible must also be installed.
How to do it...
- Install yamllint, as shown in the following code snippet:
$ sudo pip3 install yamllint
- Install ansible-lint, as shown in the following code...