# PSRP do not read vault files

**URL:** <https://forum.ansible.com/t/psrp-do-not-read-vault-files/45783>\
**Category:** Get Help\
**Tags:** windows\
**Created:** [May 8, 2026, 10:10am UTC](https://forum.ansible.com/t/psrp-do-not-read-vault-files/45783 "2026-05-08T10:10:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.gennari](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@a.gennari](https://forum.ansible.com/u/a.gennari)\
**Post date:** [May 8, 2026, 10:10am UTC](https://forum.ansible.com/t/psrp-do-not-read-vault-files/45783/1 "2026-05-08T10:10:13Z")

</div>

Hello, this is my ansible version:

```auto
ansible [core 2.20.5]
  config file = /home/ansible-dev/ansible-projects/ansible-infra/ansible.cfg
  configured module search path = ['/home/ansible-dev/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansible-dev/.ansible-venv/lib/python3.13/site-packages/ansible
  ansible collection location = /home/ansible-dev/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansible-dev/.ansible-venv/bin/ansible
  python version = 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] (/home/ansible-dev/.ansible-venv/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)

```

And I am trying to use PSRP 0.9.1

I have an issue with a simple playbook that contains only a ping and gathering of os version (Windows Server 2019)

The problem is that if I put connection properties in the inventory or in the playbook, this one works. If I try to put the same parameters in host\_vars or group\_vars folders (I tried both encrypted o not encrypted vault versions) I have this error:

```auto
TASK [Ping WinRM] ***********************************************************************************************************************************************************************************************************************************
task path: /home/ansible-dev/ansible-projects/ansible-infra/playbooks/windows/test_win.yml:7
[ERROR]: Task failed: Failed to connect to the host via ssh: ssh: connect to host 10.39.201.165 port 22: Connection refused
Origin: /home/ansible-dev/ansible-projects/ansible-infra/playbooks/windows/test_win.yml:7:7

5
6 tasks:
7 - name: Ping WinRM
        ^ column 7

fatal: [tgrp-test]: UNREACHABLE! => {
    "changed": false,
    "msg": "Task failed: Failed to connect to the host via ssh: ssh: connect to host 10.39.201.165 port 22: Connection refused",
    "unreachable": true
}

PLAY RECAP ******************************************************************************************************************************************************************************************************************************************
tgrp-test : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

```

This is my laybook:

```auto
---
- name: Test connettività Windows 2019
  hosts: cusona_windows
  gather_facts: false
  vars:
    ansible_connection: psrp
    ansible_port: 5985
    ansible_psrp_auth: ntlm
    ansible_user: "foo"
    ansible_password: "bar"
    ansible_psrp_cert_validation: ignore
  tasks:
    - name: Ping WinRM
      ansible.windows.win_ping:

    - name: Info SO
      ansible.windows.setup:

    - name: Mostra versione
      debug:
        var: ansible_os_name

```

This is the inventory occurrence:

tgrp-test ansible\_host=10.39.201.165

I have several windows machine out of the domain with their own users and passwords, and I wuold like to avoid to put user and passwords in inventory or in the playbooks.

Can you please help me to understand why I have this behavior?

Thanks in advance.

Very kind regards.

Alessio

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [May 18, 2026, 12:37pm UTC](https://forum.ansible.com/t/psrp-do-not-read-vault-files/45783/2 "2026-05-18T12:37:39Z")

</div>

Welcome to the forum! Hopefully you got this sorted, but if not, please share the layout of `host_vars`/`group_vars` in relation to your inventory file and playbook. The error message indicates the variables were not found. There are some examples [here](https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html#organizing-host-and-group-variables).
