From 808391953c472cb26cc8993fc3362f55ef3b2b61 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 25 Jan 2023 20:53:46 +0100 Subject: [PATCH] support kdbx key file for attachment extraction the lookup plugin supports using a key file, but the module didn't. This small patch adds support for specifying a key file for accessing the kdbx file. --- plugins/modules/attachment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/modules/attachment.py b/plugins/modules/attachment.py index 8b8ef5d..9523ef9 100644 --- a/plugins/modules/attachment.py +++ b/plugins/modules/attachment.py @@ -110,7 +110,7 @@ def check_file_attrs(module, result, diff): def export_attachment(module, result): try: # load database - kp = PyKeePass(module.params["database"], password=module.params["password"]) + kp = PyKeePass(module.params["database"], password=module.params["password"], keyfile=module.params["keyfile"]) entrypath = module.params["entrypath"] dest = module.params["dest"] @@ -170,6 +170,7 @@ def main(): module_args = dict( database=dict(type="str", required=True), password=dict(type="str", no_log=True, required=True), + keyfile=dict(type="str", no_log=True, required=False), entrypath=dict(type="str", required=True), attachment=dict(type="str", required=True), dest=dict(type="path", required=True),