`Could not find or access 'nginx.conf.j2' Searched in: .../roles/nginx/templates/nginx.conf.j2 ...`
BeginnerTroubleshootingModules, Idempotency and Handlers
Answer
Likely causes → The file sits in the wrong folder (for example roles/nginx/files/), the case differs, or src includes the folder name (templates/nginx.conf.j2), which some layouts tolerate but which breaks when the task is moved.
Diagnose → The error lists every path Ansible searched. Compare them with find roles/nginx -name 'nginx.conf*'.
Fix → Put templates in roles/<role>/templates/ and static files in roles/<role>/files/, and refer to them by filename only.
Prevent → Use ansible-galaxy role init to create roles with the standard directory layout.
More on Modules, Idempotency and Handlers
`ERROR! The requested handler 'Restart nginx' was not found in either the main handlers list nor in the listening handlers list`BeginnerA handler named `restart {{ app_service }}` is never found when notified as `restart myapp`AdvancedA `command` task reports `changed` on every run, and the Molecule idempotence check failsBeginner`curl ... | tar xz` fails on the host but the `shell` task reports successIntermediate`lineinfile` appends the same line again on every runIntermediate`lineinfile` with `backrefs: true` reports `ok` but the line was never addedIntermediate