title: PyYAML error: Could not determine a constructor for the tag '!vault'
body: <p>I am trying to read a YAML file that has the tag <code>!vault</code> in it. I get the error:</p>
  <blockquote>
  <p>could not determine a constructor for the tag '!vault'</p>
  </blockquote>
  <p>Upon reading a couple of blogs, I understood that I need to specify some constructors to resolve this issue, but I'm not clear on how to do it.</p>
  <pre><code>import yaml
  from yaml.loader import SafeLoader
      
  with open('test.yml' ) as stream:
      try:
          inventory_info = yaml.safe_load(stream)
      except yaml.YAMLError as exc:
          print(exc)
  
  User = inventory_info['all']['children']['linux']['vars']['user']
  key = inventory_info['all']['children']['linux']['vars']['key_file']
  </code></pre>
  <p>The YAML file I am using:</p>
  <pre><code>all:
    children:
      rhel:
        hosts: 172.18.144.98
      centos:
        hosts: 172.18.144.98  
      linux:
        children:
          rhel:
          centos:
        vars:
          user: &quot;o9ansibleuser&quot;
          key_file: &quot;test.pem&quot;
          ansible_password: !vault |
            $ANSIBLE_VAULT;2.1;AES256
            3234567899353936376166353
  </code></pre>