Suppressing YAML warning in vscode when !vault is used in var files?

I’ve been trying to figure out how to get the YAML VSCODE module to stop reporting a problem in my ansible var files, such as this one, where it highlights !vault as an unresolved tag.

ansible_connection: winrm
ansible_winrm_transport: credssp
ansible_winrm_scheme: https
ansible_winrm_server_cert_validation: ignore
ansible_port: 5986
ansible_user: ‘(REDACTED)’
ansible_password: !vault |


I don’t use VS Code, but according to the documentation you can define custom tags in the settings of the code editor like so:

"yaml.customTags": [
    "!vault scalar"

Thanks, that seems to have gotten rid of the ugly red highlighting.

Hi and welcome to the community forum @gawainsr!

I’m glad the issue is solved. If the reply by @flowerysong helped you solve the issue, please tick the checkbox at the bottom of his comment to mark the topic as solved and their answer as the correct one, this will help other people as well as provide recognition within the forum.


If you get to a point where you consider a post by someone helped you to solve the issue, please tick :white_check_mark: the check-box below their message:


This will mark the message as the solution and show it in the first post for easy access, as well as recognize the person that helped:


Let us know if you have any questions or doubts!