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

**URL:** <https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282>\
**Category:** Get Help\
**Tags:** windows, vscode-ansible, collections\
**Created:** [November 10, 2023, 2:23am UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282 "2023-11-10T02:23:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gawainsr](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@gawainsr](https://forum.ansible.com/u/gawainsr)\
**Post date:** [November 10, 2023, 2:23am UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282/1 "2023-11-10T02:23:33Z")

</div>

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 |  
$ANSIBLE\_VAULT;1.1;(REDACTED)

Thanks!

---

<div class="post-metadata">

**Author:** ![flowerysong](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/flowerysong/32/2305_2.png) [@flowerysong](https://forum.ansible.com/u/flowerysong)\
**Post date:** [November 10, 2023, 5:25am UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282/2 "2023-11-10T05:25:05Z")

</div>

I don’t use VS Code, but according to [the documentation](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) you can define custom tags in the settings of the code editor like so:

```auto
"yaml.customTags": [
    "!vault scalar"
]

```

---

<div class="post-metadata">

**Author:** ![gawainsr](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@gawainsr](https://forum.ansible.com/u/gawainsr)\
**Post date:** [November 14, 2023, 7:56pm UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282/3 "2023-11-14T19:56:55Z")

</div>

> [@flowerysong](#):
>
> `"!vault scalar"`

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

---

<div class="post-metadata">

**Author:** ![Leo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leo/32/23_2.png) [@Leo](https://forum.ansible.com/u/Leo)\
**Post date:** [November 15, 2023, 4:54am UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282/4 "2023-11-15T04:54:49Z")

</div>

Hi and welcome to the community forum @gawainsr!

> [@gawainsr](#):
>
> Thanks, that seems to have gotten rid of the ugly red highlighting.

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.

## Solutions

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

![image](https://us1.discourse-cdn.com/ansible/original/1X/de4bda8ca15f48c52ff19f12b452d10c02126f7f.png)

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:

![image](https://us1.discourse-cdn.com/ansible/original/1X/8964a515490358701e2c80d4ab69712f980e764c.png)

Let us know if you have any questions or doubts!

---

<div class="post-metadata">

**Author:** ![laurent-indermuehle](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/laurent-indermuehle/32/289_2.png) [@laurent-indermuehle](https://forum.ansible.com/u/laurent-indermuehle)\
**Post date:** [June 1, 2025, 11:46am UTC](https://forum.ansible.com/t/suppressing-yaml-warning-in-vscode-when-vault-is-used-in-var-files/2282/5 "2025-06-01T11:46:13Z")

</div>

For Zed the config looks like this:

```auto
// Zed settings
{
  "lsp": {
     "yaml-language-server": {
      "settings": {
        "yaml": {
          "customTags": [
            "!vault scalar"
          ]
        }
      }
    }
  }
}

```
