mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
Fixes service disable when service has no certificates attached.
Services without certificates, but with keytabs were not being
disabled. This change allows execution of service_disable if
there is a certificate or if has_keytab is true.
A new test was added to verify the issue:
tests/service/test_service_disable.yml
This commit is contained in:
@@ -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'" %
|
||||
|
||||
Reference in New Issue
Block a user