diff --git a/library/nextcloud_ldap.py b/library/nextcloud_ldap.py index 4ecdf06..399f19a 100644 --- a/library/nextcloud_ldap.py +++ b/library/nextcloud_ldap.py @@ -12,7 +12,7 @@ def run_module(): result = { 'changed': False, - # 'message': '', + 'message': '', 'diff': {'before': {}, 'after': {}} } @@ -73,9 +73,9 @@ def run_module(): if not module.check_mode: try: - rc, stdout, stderr = module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], key, - ';'.join(new_config[key]) if isinstance(new_config[key], list) else str(new_config[key])], - check_rc=True, cwd=module.params['nextcloud_path']) + module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], key, + ';'.join(new_config[key]) if isinstance(new_config[key], list) else str(new_config[key])], + check_rc=True, cwd=module.params['nextcloud_path']) except Exception as e: module.fail_json(msg="Error on key " + key + " : " + str(e), **result) @@ -86,12 +86,12 @@ def run_module(): module.fail_json(msg=f"LDAP connection test failed: {stdout}", **result) if not module.check_mode: - rc, stdout, stderr = module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], 'ldapConfigurationActive', - '1'], check_rc=True, cwd=module.params['nextcloud_path']) + module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], 'ldapConfigurationActive', '1'], check_rc=True, + cwd=module.params['nextcloud_path']) # set update interval, seems necessary to activate sync. - rc, stdout, stderr = module.run_command(['/usr/bin/php', 'occ', 'config:app:set', 'user_ldap' 'updateAttributesInterval' '--value=86400'], - check_rc=True, cwd=module.params['nextcloud_path']) + module.run_command(['/usr/bin/php', 'occ', 'config:app:set', 'user_ldap' 'updateAttributesInterval' '--value=86400'], check_rc=True, + cwd=module.params['nextcloud_path']) module.exit_json(**result)