Ad wrap_ttl support to approle secret create
@@ -56,6 +56,9 @@ options:
metadata:
description:
- Metadata to be tied to the secret.
+ wrap_ttl:
+ description:
+ - Wrap TTL.
'''
EXAMPLES = '''
---
@@ -73,6 +76,7 @@ def main():
argspec['name'] = dict(required=True, type='str')
argspec['cidr_list'] = dict(required=False, type='str')
argspec['metadata'] = dict(required=False, type='dict')
+ argspec['wrap_ttl'] = dict(required=False, type='str')
module = hashivault_init(argspec)
result = hashivault_approle_role_secret_create(module.params)
if result.get('failed'):
@@ -90,11 +94,14 @@ def hashivault_approle_role_secret_create(params):
name = params.get('name')
cidr_list = params.get('cidr_list')
metadata = params.get('metadata')
+ wrap_ttl = params.get('wrap_ttl')
kwargs = {}
if cidr_list is not None:
kwargs['cidr_list'] = cidr_list
if metadata is not None:
kwargs['meta'] = metadata
+ if wrap_ttl is not None:
+ kwargs['wrap_ttl'] = wrap_ttl
client = hashivault_auth_client(params)
result = client.create_role_secret_id(name, **kwargs)
return result['data']
