ansible-keepass icon indicating copy to clipboard operation
ansible-keepass copied to clipboard

Recover the attachment contents directly

Open killerrex opened this issue 1 year ago • 1 comments

Hi,

I am using this plugin to keep all the user information (passwords, ssh keys...) centralised in a kdbx file and is working great.

The only issue I found is with the attachments, that as they are extracted in a temporal local file it is complex to transfer them between hosts.

As normally all the attachments I have are small plain text files, I have done a modification that allows to recover the content of the attachment directly in the variable like:

  vars:
    content: "{{ lookup('viczem.keepass.keepass', 'example/pork', 'content', 'test.txt')}}"
  task:
    - debug:
        msg: "Content of the file is {{ content }}"

so there are no temporal files created anyplace.

If you think it is useful I can do a PR from my fork I do not know if it can be useful to add the capacity to specify the encoding or return raw bytes...

killerrex avatar Sep 12 '23 12:09 killerrex