Merge pull request #417 from LIV2/main

Fixup idempotency of hashivault_auth_ldap
This commit is contained in:
Terry Howe 2022-09-11 09:09:54 -06:00 committed by GitHub
commit 49659840ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -139,8 +139,8 @@ def main():
argspec['group_attr'] = dict(required=False, type='str', default='cn')
argspec['group_dn'] = dict(required=False, type='str', default='')
argspec['use_token_groups'] = dict(required=False, type='bool', default=False)
argspec['token_ttl'] = dict(required=False, type='str', default='')
argspec['token_max_ttl'] = dict(required=False, type='str', default='')
argspec['token_ttl'] = dict(required=False, type='int', default=0)
argspec['token_max_ttl'] = dict(required=False, type='int', default=0)
module = hashivault_init(argspec, supports_check_mode=True)
result = hashivault_auth_ldap(module)

View File

@ -18,11 +18,17 @@
- name: ldap configuration
hashivault_auth_ldap:
ldap_url: ldap://127.0.0.1
ldap_url: ldap://localhost
register: ldap_module
- assert: { that: "{{ ldap_module.changed }} == True" }
- assert: { that: "{{ ldap_module.rc }} == 0" }
- name: ldap configuration is idempotent
hashivault_auth_ldap:
ldap_url: ldap://localhost
register: ldap_module_idempotent
- assert: { that: "{{ ldap_module_idempotent.changed }} == False" }
- name: remove ldap group
hashivault_ldap_group:
name: test