# ansible-su-pass doesn't work with vault

**URL:** <https://forum.ansible.com/t/ansible-su-pass-doesnt-work-with-vault/18019>\
**Category:** Ansible Developer\
**Created:** [April 20, 2015, 11:06am UTC](https://forum.ansible.com/t/ansible-su-pass-doesnt-work-with-vault/18019 "2015-04-20T11:06:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shanmukh](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Shanmukh](https://forum.ansible.com/u/Shanmukh)\
**Post date:** [April 20, 2015, 11:06am UTC](https://forum.ansible.com/t/ansible-su-pass-doesnt-work-with-vault/18019/1 "2015-04-20T11:06:54Z")

</div>

Hi, I am relatively new with Ansible.

This is my requirement: I have a list of some thousand instances which i need to connect as ‘su’ user and run a playbook for these instances. For each instance I need to enter the password manually. In order to avoid this, though it is not strongly recommended i am using the vault to specify my password. But still I am not able to run the playbook.  
Following are the code snippets:

Call to playbook:  
ansible-playbook ${privilege\_opts} -l ${groups\_opts} -i ${inventory\_opts} ${playbook} --vault-password-file ~/vault.txt

In ‘vault.txt’ i have given a single string password. (E.g: abc)

The playbook has the following file included:  
vars\_files:

- red

‘red’ is the file where my actual password is there like this:

ansible-su-pass: mypassword

When i run the playbook it just hangs. What i found interesting here is that, this approach absolutely works fine for ‘sudo’. I am wondering why this does not work for ‘su’. Am i missing something

Greatly appreciate your help!

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 20, 2015, 12:57pm UTC](https://forum.ansible.com/t/ansible-su-pass-doesnt-work-with-vault/18019/2 "2015-04-20T12:57:47Z")

</div>

The variable is ansible\_su\_pass not ansible-su-pass

---

<div class="post-metadata">

**Author:** ![Shanmukh](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Shanmukh](https://forum.ansible.com/u/Shanmukh)\
**Post date:** [April 20, 2015, 2:23pm UTC](https://forum.ansible.com/t/ansible-su-pass-doesnt-work-with-vault/18019/3 "2015-04-20T14:23:29Z")

</div>

I am sorry for the confusion.

I am actually using ansible\_su\_pass, but still it doesn’t work
