Ansible Rules
Automate IT infrastructure with playbooks, roles, and inventories. Configure servers, deploy apps, and orchestrate tasks.
3 rules
Ensure All Tasks Are Idempotent
Intermediate
Every Ansible task must be idempotent — running a playbook multiple times must produce the same result as running it once. Use modules instead of shell/command, and add conditions to raw commands.
globs: **/*.yml, **/*.yaml, **/ansible/**, **/playbooks/**, **/roles/**
idempotency, modules, best-practices, reliability
View Rule
Name Every Ansible Task
Beginner
Every Ansible task must have a descriptive name — unnamed tasks are impossible to debug, provide no documentation value, and make playbook output unreadable.
globs: **/*.yml, **/*.yaml, **/ansible/**, **/playbooks/**, **/roles/**
task-naming, readability, debugging, ansible-lint
View Rule
Use Fully Qualified Collection Names
Beginner
Always use fully qualified collection names (FQCNs) for Ansible modules — ansible.builtin.copy instead of copy — to prevent ambiguity, ensure correct module resolution, and future-proof playbooks.
globs: **/*.yml, **/*.yaml, **/ansible/**, **/playbooks/**, **/roles/**
fqcn, collections, modules, ansible-lint
View Rule