From 23d2a44d50e3041b0a31f7a6ebce6532c37aba8a Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Wed, 27 Dec 2023 20:30:39 +0100 Subject: [PATCH] feat(module): some more on vault init --- plugins/modules/vault_init.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/modules/vault_init.py b/plugins/modules/vault_init.py index 2d16358..ec0621e 100644 --- a/plugins/modules/vault_init.py +++ b/plugins/modules/vault_init.py @@ -83,9 +83,7 @@ def run_module(): module_args = dict( api_url=dict(type='str', required=True), key_shares=dict(type='int', required=False,default=5), - key_treshold=dict(type='int',required=False,default=3), - name=dict(type='str', required=True), - new=dict(type='bool', required=False, default=False) + key_treshold=dict(type='int',required=False,default=3) ) # seed the result dict in the object @@ -108,6 +106,13 @@ def run_module(): supports_check_mode=True ) + + if not HAS_HVAC: + module.fail_json( + msg=missing_required_lib('hvac'), + exception=HVAC_IMPORT_ERROR + ) + # if the user is working with this module in only check mode we do not # want to make any changes to the environment, just return the current # state with no modifications