Menu

Ansible Lint GitHub Actions: Fail PRs on Bad Playbooks
📰

Ansible Lint GitHub Actions: Fail PRs on Bad Playbooks

DEV Community: cicd·Amaresh Pelleti·2 days ago
#xbdc8Xw9
#devtocicd#devto#dev#ansible#lint
Reading 0:00
15s threshold

Originally published on DevToolHub .

I ran ansible-lint against a four-task playbook that looked fine at a glance. It reported 14 violations and exited with code 2. Setting up that same check as an Ansible Lint GitHub Actions workflow takes about ten lines of YAML, so the broken playbook never reaches main . This guide covers the workflow, the profile you should enforce, and a trap with ignore files that I hit while testing.

Everything below was run with ansible-lint 26.10.1 and ansible-core 2.21.5 on Python 3.14.

Why Add an Ansible Lint GitHub Actions Check?

An Ansible Lint GitHub Actions check turns style and safety rules into a required check on every pull request. A reviewer no longer has to spot a missing mode: on a copy task or a shell call that runs on every play. The check fails, the PR stays red, and the author fixes it before anyone reads the diff.

It also catches the quiet problems.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.