YAML spacing causing unexpected behavior?

Hey Everyone,

I’m still getting the hang of Ansible, and I’m running into a weird issue—some of my tasks seem to be skipped entirely, and I think it might be due to indentation or spacing in my YAML files.

I’ve tried checking with YAML linters and even reformatting, but the problem persists in some spots.

Has anyone else had tasks silently fail or get skipped due to tiny formatting issues? Or am I maybe missing something obvious?

Thanks in advance!

What does ansible-lint return? Can you post the YAML in question?

invalid indentation would result in an error, is the task ignored or do you get a skipped message.

Showing the play and output (even better with -vvv) can go a long to allow others to help you.

1 Like