Use <afile> instead of % when detecting the file type.

It is possible that other autocommands could set the current file (%) to
something other than the file being edited. Compare
$VIMRUNTIME/filetype.vim.
Be more careful checking directory path.

Look for "/roles/" instead of "roles/" in the file path.
Coding style: use " . " for concatenation, not ".".
Documentation: be explicit about recognizing Ansible files.
Style: remove an unnecessary "else" block.
Style: add some blank lines.
Style: put the autocommand at the top of the file.

Compare $VIMRUNTIME/filetype.vim .
Move settings into an ftplugin file.
Use :setlocal instead of :set.
Fix a typo in a comment.