diff --git a/plugins/modules/ipavault.py b/plugins/modules/ipavault.py index 8562ff722238a991bfbeeaf86402136f2439af5b..dffd9722df868c132458fc83aa4f3bc840f11b89 100644 --- a/plugins/modules/ipavault.py +++ b/plugins/modules/ipavault.py @@ -768,7 +768,12 @@ def main(): commands.append([name, "vault_mod_internal", args]) else: + if vault_type == 'symmetric' \ + and 'ipavaultsalt' not in args: + args['ipavaultsalt'] = os.urandom(32) + commands.append([name, "vault_add_internal", args]) + if vault_type != 'standard' and vault_data is None: vault_data = '' @@ -826,14 +831,6 @@ def main(): commands.append( [name, 'vault_remove_owner', owner_del_args]) - if vault_type == 'symmetric' \ - and 'ipavaultsalt' not in args: - args['ipavaultsalt'] = os.urandom(32) - - if vault_type == 'symmetric' \ - and 'ipavaultsalt' not in args: - args['ipavaultsalt'] = os.urandom(32) - elif action in "member": # Add users and groups if any([users, groups, services]):