Ansible is a popular IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.
Ansible Linter is not enabled by default to not analyze random YAML files in your repository. If you want to leverage this Infrastructure as Code analysis, add the
.codeac.yml configuration file below to your repository root. Also, specify path to your Ansible roles and playbooks to eliminate errors from other YAML files.
version: '1' tools: ansibleLint: files: - playbooks/**/*.yml - roles/
Ansible Linter requires configuration via a
.ansible-lint configuration file as detailed in Ansible Linter's documentation .
exclude_paths: - ./my/excluded/directory/ - ./my/other/excluded/directory/ - ./last/excluded/directory/
Ansible’s philosophy is that it should be declarative. Changing things only when they are needed improves your reliability as well as execution performance. Also, proper task names add documentation to your playbook.