*** ansible-keepassxc.py.dst 2022-04-07 15:14:39.222017589 +0000 --- ansible-keepassxc.py 2022-04-07 15:12:28.010013156 +0000 *************** *** 2,11 **** --- 2,22 ---- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type + import os + import traceback + from ansible.module_utils.basic import AnsibleModule, missing_required_lib + + IMPORT_ERR = None + try: + import _argon2_xffi_bindings + import pykeepass as keepass + except ImportError: + IMPORT_ERR = traceback.format_exc() + DOCUMENTATION = r''' --- module: ansible-keepassxc short_description: Module to read credentials from KeePassXC *************** *** 89,112 **** type: dict returned: always sample: False ''' - from ansible.module_utils.basic import AnsibleModule, missing_required_lib - import traceback - - IMPORT_ERR = None - try: - import pykeepass as keepass - except ImportError: - IMPORT_ERR = traceback.format_exc() - def run_module(): # define available arguments/parameters a user can pass to the module module_args = dict( database = dict(type='str', required=True), ! password = dict(type='str', required=True), keyfile = dict(type='str', required=False, default=None), entry = dict(type='str', required=True), group = dict(type='str', required=False), ) --- 100,115 ---- type: dict returned: always sample: False ''' def run_module(): # define available arguments/parameters a user can pass to the module module_args = dict( database = dict(type='str', required=True), ! password = dict(type='str', required=False, ! default=os.environ.get('ANSIBLE_KEEPASSXC_PASSWORD')), keyfile = dict(type='str', required=False, default=None), entry = dict(type='str', required=True), group = dict(type='str', required=False), )