ansible-keepass: Attachment content not being updated
I’ve added an attachment to my file with certain content: I read it like this:
- name: Backend postgres vars
ansible.builtin.include_vars:
file: "{{ lookup('viczem.keepass.keepass', 'infrastructure/infisical', 'attachments', 'infisical-postgres.yml') }}"
name: infisical_postgres_env
However I’ve noticed that whenever I change the attachment in DB, this plugin still reads old value on next run.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (7 by maintainers)
Yes, in memory decrypted data of your kdbx file, while socket is open
To clarify, TTL starts counting from the moment of the last access to the socket. In other words, we specify the idle time after which the socket will close automatically. If the task in the playbook is so long that it exceeds the TTL, the socket will be closed and when Ansible accesses the plugin, a new socket will be created.
Without a socket, there will be many operations with kdbx file decryption (essentially as many times as Ansible will read the variable). But through a socket the decryption once at the start.
This plugin is for read-only kdbx files. It is assumed that you will use a kdbx file without need to change anything in it during running Ansible process.
I just tested and found no problems with TTL (default is 60 seconds). You can also close socket by https://github.com/viczem/ansible-keepass/blob/b633a57fc316c86f5b0c2b3b7afcd5eccdde4a62/docs/examples/example-playbook.yml#L38