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.
Python and PIP package manager must be already installed on your Linux machine, and Ansible must also be installed.
- Install yamllint, as shown in the following code snippet:
$ sudo pip3 install yamllint
- Install ansible-lint, as shown in the following code...