# Any way to include\_vars on output of a filter?

**URL:** <https://forum.ansible.com/t/any-way-to-include-vars-on-output-of-a-filter/29287>\
**Category:** Ansible Project\
**Created:** [December 18, 2018, 4:05pm UTC](https://forum.ansible.com/t/any-way-to-include-vars-on-output-of-a-filter/29287 "2018-12-18T16:05:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelley\_Spoon](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@Kelley\_Spoon](https://forum.ansible.com/u/Kelley_Spoon)\
**Post date:** [December 18, 2018, 4:05pm UTC](https://forum.ansible.com/t/any-way-to-include-vars-on-output-of-a-filter/29287/1 "2018-12-18T16:05:13Z")

</div>

Howdy folks,

I’m looking for some advice to see if there’s a more elegant way to  
do an “include\_vars” on the output of a filter rather than a file.

I’m using the “passwordstore” module to get secrets out of ‘pass’.  
This works great for pulling in a single var at a time, but I’d like  
to be able to import an entire host/group vars file.

Currently what I’ve got working is something like:

- create a temporary local file with contents of the lookup(‘passwordstore’)  
filter output using local\_action
- include\_vars on the temp file
- delete temp file with another local\_action

I was just wondering if anyone’s got an easier way to do this or a one-liner  
that can merge the output of lookup(‘passwordstore’) into ansible’s vars table.

Also, I know about Vault, but can’t use it in this case.

Thanks,

Kelley Spoon
