def METHOD_NAME(ansible_inventory_path, playbook_parameters, raise_on_error=True, output=False,
                        log_ansible_error=True):
    """Run the ansible tasks given from playbook parameters
    Args:
        ansible_inventory_path (string): Path were the ansible directory is placed.
        playbook_parameters : Parameters for the ansible playbook.
        raise_on_error (boolean): Set if errors or unexpected behaviour are goint to raise errors, Set to 'True'
                                  by default.
        output (boolean): Set if there are going to be outputs. Set to 'False' by default.
        log_ansible_error (boolean): True for logging the error exception message if any.
    Returns:
        AnsibleOutput: Result of the ansible playbook run.
    """
    ansible_playbook = AnsiblePlaybook(**playbook_parameters)
    quiet = not output
    try:
        AnsibleRunner.LOGGER.debug(f"Running {ansible_playbook.playbook_file_path} ansible-playbook with "
                                   f"{ansible_inventory_path} inventory")
        runner = ansible_runner.run(playbook=ansible_playbook.playbook_file_path, inventory=ansible_inventory_path,
                                    quiet=quiet, envvars={'ANSIBLE_GATHER_TIMEOUT': 30, 'ANSIBLE_TIMEOUT': 20})
        ansible_output = AnsibleOutput(runner)
        if ansible_output.rc != 0 and raise_on_error:
            raise AnsibleException(f'Failed: {ansible_output}', AnsibleRunner.LOGGER.error, QACTL_LOGGER) if \
                log_ansible_error else AnsibleException(f'Failed: {ansible_output}')
        return ansible_output
    finally:
        ansible_playbook.delete_playbook_file()
        shutil.rmtree(runner.config.private_data_dir)