Any way to include_vars on output of a filter?

9 views
Skip to first unread message

Kelley Spoon

unread,
Dec 18, 2018, 11:05:13 AM12/18/18
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages