Merge pull request #308 from rjeffman/ipaservice_fix_service_disable

Fixes service disable when service has no certificates attached.
This commit is contained in:
Sergio Oliveira
2020-06-26 17:36:35 -03:00
committed by GitHub
2 changed files with 73 additions and 3 deletions

View File

@@ -812,9 +812,11 @@ def main():
elif state == "disabled":
if action == "service":
if res_find is not None and \
len(res_find.get('usercertificate', [])) > 0:
commands.append([name, 'service_disable', {}])
if res_find is not None:
has_cert = bool(res_find.get('usercertificate'))
has_keytab = res_find.get('has_keytab', False)
if has_cert or has_keytab:
commands.append([name, 'service_disable', {}])
else:
ansible_module.fail_json(
msg="Invalid action '%s' for state '%s'" %