# How to generate and store passwords securely with lookup?

**URL:** <https://forum.ansible.com/t/how-to-generate-and-store-passwords-securely-with-lookup/37901>\
**Category:** Ansible Project\
**Created:** [April 19, 2023, 10:05am UTC](https://forum.ansible.com/t/how-to-generate-and-store-passwords-securely-with-lookup/37901 "2023-04-19T10:05:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melodie\_O](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@Melodie\_O](https://forum.ansible.com/u/Melodie_O)\
**Post date:** [April 19, 2023, 10:05am UTC](https://forum.ansible.com/t/how-to-generate-and-store-passwords-securely-with-lookup/37901/1 "2023-04-19T10:05:18Z")

</div>

Hello,

I am generating random passwords using the lookup plugin. My issue is that I would like these passwords to be stored securely. I have searched everywhere but haven’t found a solution to my problem.

Therefore, I modified the lookup plugin and am using ansible-vault to encrypt and store the passwords in a file.

Does this feature seem interesting to you and should I contribute to the project ?  
Or, am I approaching this with the wrong logic?

Thank you in advance for your response.

---

<div class="post-metadata">

**Author:** ![Mike\_Eggleston](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Eggleston](https://forum.ansible.com/u/Mike_Eggleston)\
**Post date:** [April 19, 2023, 10:54am UTC](https://forum.ansible.com/t/how-to-generate-and-store-passwords-securely-with-lookup/37901/2 "2023-04-19T10:54:38Z")

</div>

Add the change to the module is my vote.

Mike
