def update_playbook_task_name(playbook):
    """
    update the name of the task to be the same as playbookName it is running

    :param playbook: playbook dict loaded from yaml
    :return: updated playbook dict
    """
    for task_id, task in playbook.get("tasks", {}).items():
        if task.get("type") == "playbook":
            task["task"]["name"] = task["task"]["playbookName"]

    return playbook