The cause of this issue is that the ansible extension (https://marketplace.visualstudio.com/items?itemName=vscoss.vscode-ansible) doesn't recognize the given file as its supported item. To get rid of it, try editing the settings.json of VSCode to add the following configuration:
"files.associations": {
"**/*.yml": "ansible"
},
"ansible.validation": true