cleanup
This commit is contained in:
parent
bb994f6326
commit
84ffb7479b
1 changed files with 8 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ def run_module():
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'changed': False,
|
'changed': False,
|
||||||
# 'message': '',
|
'message': '',
|
||||||
'diff': {'before': {}, 'after': {}}
|
'diff': {'before': {}, 'after': {}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,9 +73,9 @@ def run_module():
|
||||||
|
|
||||||
if not module.check_mode:
|
if not module.check_mode:
|
||||||
try:
|
try:
|
||||||
rc, stdout, stderr = module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], key,
|
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])],
|
';'.join(new_config[key]) if isinstance(new_config[key], list) else str(new_config[key])],
|
||||||
check_rc=True, cwd=module.params['nextcloud_path'])
|
check_rc=True, cwd=module.params['nextcloud_path'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
module.fail_json(msg="Error on key " + key + " : " + str(e), **result)
|
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)
|
module.fail_json(msg=f"LDAP connection test failed: {stdout}", **result)
|
||||||
|
|
||||||
if not module.check_mode:
|
if not module.check_mode:
|
||||||
rc, stdout, stderr = module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], 'ldapConfigurationActive',
|
module.run_command(['/usr/bin/php', 'occ', 'ldap:set-config', module.params['config']['config_id'], 'ldapConfigurationActive', '1'], check_rc=True,
|
||||||
'1'], check_rc=True, cwd=module.params['nextcloud_path'])
|
cwd=module.params['nextcloud_path'])
|
||||||
|
|
||||||
# set update interval, seems necessary to activate sync.
|
# 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'],
|
module.run_command(['/usr/bin/php', 'occ', 'config:app:set', 'user_ldap' 'updateAttributesInterval' '--value=86400'], check_rc=True,
|
||||||
check_rc=True, cwd=module.params['nextcloud_path'])
|
cwd=module.params['nextcloud_path'])
|
||||||
|
|
||||||
module.exit_json(**result)
|
module.exit_json(**result)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue