# Path: ansible/module_utils/hashivault.py
# def hashivault_argspec():
#     argument_spec = dict(
#         url=dict(required=False, default=os.environ.get('VAULT_ADDR', ''), type='str'),
#         ca_cert=dict(required=False, default=os.environ.get('VAULT_CACERT', ''), type='str'),
#         ca_path=dict(required=False, default=os.environ.get('VAULT_CAPATH', ''), type='str'),
#         client_cert=dict(required=False, default=os.environ.get('VAULT_CLIENT_CERT', ''), type='str'),
#         client_key=dict(required=False, default=os.environ.get('VAULT_CLIENT_KEY', ''), type='str'),
#         verify=dict(required=False, default=(not os.environ.get('VAULT_SKIP_VERIFY', '')), type='bool'),
#         authtype=dict(required=False, default=os.environ.get('VAULT_AUTHTYPE', 'token'), type='str'),
#         login_mount_point=dict(required=False, default=os.environ.get('VAULT_LOGIN_MOUNT_POINT', None), type='str'),
#         token=dict(required=False, fallback=(hashivault_default_token, ''), type='str', no_log=True),
#         username=dict(required=False, default=os.environ.get('VAULT_USER', ''), type='str'),
#         password=dict(required=False, fallback=(env_fallback, ['VAULT_PASSWORD']), type='str', no_log=True),
#         role_id=dict(required=False, fallback=(env_fallback, ['VAULT_ROLE_ID']), type='str', no_log=True),
#         secret_id=dict(required=False, fallback=(env_fallback, ['VAULT_SECRET_ID']), type='str', no_log=True),
#         aws_header=dict(required=False, fallback=(env_fallback, ['VAULT_AWS_HEADER']), type='str', no_log=True),
#         namespace=dict(required=False, default=os.environ.get('VAULT_NAMESPACE', None), type='str')
#     )
#     return argument_spec
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_auth_client(params):
#     client = hashivault_client(params)
#     return hashivault_auth(client, params)
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_init(argument_spec, supports_check_mode=False, required_if=None, required_together=None,
#                     required_one_of=None, mutually_exclusive=None):
#     module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=supports_check_mode,
#                            required_if=required_if, required_together=required_together,
#                            required_one_of=required_one_of, mutually_exclusive=mutually_exclusive)
#     module.no_log_values.discard('0')
#     module.no_log_values.discard(0)
#     module.no_log_values.discard('1')
#     module.no_log_values.discard(1)
#     module.no_log_values.discard(True)
#     module.no_log_values.discard(False)
#     module.no_log_values.discard('ttl')
#     return module
# 
# Path: ansible/module_utils/hashivault.py
# def hashiwrapper(function):
#     def wrapper(*args, **kwargs):
#         result = {"changed": False, "rc": 0}
#         result.update(function(*args, **kwargs))
#         return result
#     return wrapper


from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
        description:
            - If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies
              set in token_policies.
    token_num_uses:
        description:
            - The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited.
    token_period:
        description:
            - If set, indicates that the token generated using this role should never expire. The token should be
              renewed within the duration specified by this value. At each renewal, the token's TTL will be set to
              the value of this parameter.
    token_type:
        description:
            - The type of token that should be generated. Can be service, batch, or default to use the mount's tuned
              default (which unless changed will be service tokens). For token store roles, there are two additional
              possibilities (default-service and default-batch) which specify the type to return unless the client
              requests a different type at generation time.
extends_documentation_fragment: hashivault
'''
EXAMPLES = '''
---
- hosts: localhost
  tasks:
    - hashivault_oidc_auth_role:
        name: "gmail"
        bound_audiences: ["123-456.apps.googleusercontent.com"]
        allowed_redirect_uris: ["https://vault.com:8200/ui/vault/auth/oidc/oidc/callback"]
        token_policies: ["test"]

- hosts: localhost

# Path: ansible/module_utils/hashivault.py
# def hashivault_argspec():
#     argument_spec = dict(
#         url=dict(required=False, default=os.environ.get('VAULT_ADDR', ''), type='str'),
#         ca_cert=dict(required=False, default=os.environ.get('VAULT_CACERT', ''), type='str'),
#         ca_path=dict(required=False, default=os.environ.get('VAULT_CAPATH', ''), type='str'),
#         client_cert=dict(required=False, default=os.environ.get('VAULT_CLIENT_CERT', ''), type='str'),
#         client_key=dict(required=False, default=os.environ.get('VAULT_CLIENT_KEY', ''), type='str'),
#         verify=dict(required=False, default=(not os.environ.get('VAULT_SKIP_VERIFY', '')), type='bool'),
#         authtype=dict(required=False, default=os.environ.get('VAULT_AUTHTYPE', 'token'), type='str'),
#         login_mount_point=dict(required=False, default=os.environ.get('VAULT_LOGIN_MOUNT_POINT', None), type='str'),
#         token=dict(required=False, fallback=(hashivault_default_token, ''), type='str', no_log=True),
#         username=dict(required=False, default=os.environ.get('VAULT_USER', ''), type='str'),
#         password=dict(required=False, fallback=(env_fallback, ['VAULT_PASSWORD']), type='str', no_log=True),
#         role_id=dict(required=False, fallback=(env_fallback, ['VAULT_ROLE_ID']), type='str', no_log=True),
#         secret_id=dict(required=False, fallback=(env_fallback, ['VAULT_SECRET_ID']), type='str', no_log=True),
#         aws_header=dict(required=False, fallback=(env_fallback, ['VAULT_AWS_HEADER']), type='str', no_log=True),
#         namespace=dict(required=False, default=os.environ.get('VAULT_NAMESPACE', None), type='str')
#     )
#     return argument_spec
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_auth_client(params):
#     client = hashivault_client(params)
#     return hashivault_auth(client, params)
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_init(argument_spec, supports_check_mode=False, required_if=None, required_together=None,
#                     required_one_of=None, mutually_exclusive=None):
#     module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=supports_check_mode,
#                            required_if=required_if, required_together=required_together,
#                            required_one_of=required_one_of, mutually_exclusive=mutually_exclusive)
#     module.no_log_values.discard('0')
#     module.no_log_values.discard(0)
#     module.no_log_values.discard('1')
#     module.no_log_values.discard(1)
#     module.no_log_values.discard(True)
#     module.no_log_values.discard(False)
#     module.no_log_values.discard('ttl')
#     return module
# 
# Path: ansible/module_utils/hashivault.py
# def hashiwrapper(function):
#     def wrapper(*args, **kwargs):
#         result = {"changed": False, "rc": 0}
#         result.update(function(*args, **kwargs))
#         return result
#     return wrapper


# Path: ansible/modules/hashivault/hashivault_oidc_auth_role.py
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper

        description:
            - If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies
              set in token_policies.
    token_num_uses:
        description:
            - The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited.
    token_period:
        description:
            - If set, indicates that the token generated using this role should never expire. The token should be
              renewed within the duration specified by this value. At each renewal, the token's TTL will be set to
              the value of this parameter.
    token_type:
        description:
            - The type of token that should be generated. Can be service, batch, or default to use the mount's tuned
              default (which unless changed will be service tokens). For token store roles, there are two additional
              possibilities (default-service and default-batch) which specify the type to return unless the client
              requests a different type at generation time.
extends_documentation_fragment: hashivault
'''
EXAMPLES = '''
---
- hosts: localhost
  tasks:
    - hashivault_oidc_auth_role:
        name: "gmail"
        bound_audiences: ["123-456.apps.googleusercontent.com"]
        allowed_redirect_uris: ["https://vault.com:8200/ui/vault/auth/oidc/oidc/callback"]
        token_policies: ["test"]

- hosts: localhost

  tasks: