diff --git a/plugins/modules/ipahbacsvc.py b/plugins/modules/ipahbacsvc.py index c6e31d47b7c99192e85833f9a136426e816825f8..12c8476d76b84a93d2fbbc23229e656ba0d5ff01 100644 --- a/plugins/modules/ipahbacsvc.py +++ b/plugins/modules/ipahbacsvc.py @@ -180,19 +180,9 @@ def main(): else: ansible_module.fail_json(msg="Unkown state '%s'" % state) - # Check mode exit - if ansible_module.check_mode: - ansible_module.exit_json(changed=len(commands) > 0, **exit_args) - # Execute commands - for name, command, args in commands: - try: - ansible_module.ipa_command(command, name, args) - changed = True - except Exception as e: - ansible_module.fail_json(msg="%s: %s: %s" % (command, name, - str(e))) + changed = ansible_module.execute_ipa_commands(commands) # Done