After failed task on 99% of my server , the rest of the playbook is running only on the 1% servers that passed the tasks

Hi ,
I have a main playbook that uses “include” to call other playbooks.

In one of the playbooks, I have 5 tasks. The second task falls on all my servers except for one server - From that point, the entire playbook (main) is running only on that server

  1. If a task failed on a server - how can I stop the entire process
  2. In my case, why the playbook continues to run only on the server that was passed the specific task?
- hosts:
    - postgres1
    - cloudera_manager
    - worker
    - master
    - gw
    - kafka
    - repository
    - kafka_master
  become: true
  vars_files:
    - ./cloudera_environment.yml

  tasks:

  - name: update hostname
    include: hostname-update.yml

  - name: create maintenance user
    include: create_maintenance_user.yml

  - name: OS update for supporting cloudera best practice      In this playbook task number 2 is faild on all my servers except one server
    include: redhat7_bigdata_best_practice.yml                 Starting task 3 in till the end of the palybook all tasks are running on that
specific server
  - name: update repository file
include: update-yum-repo.yml

  - name: Install rpm packages
include: install-package.yml

## Install Openjdk 11 ##
- hosts:
    - postgres1
    - cloudera_manager
    - worker
    - master
    - gw
    - repository

become: true
vars_files:
    - ./cloudera_environment.yml

tasks:

  - name: Install rpm packages
include: install-java11-package.yml

Hi ,
I have a main playbook that uses "include" to call other playbooks.

In one of the playbooks, I have 5 tasks. The second task falls on all my servers except for one server - From that
point, the entire playbook (main) is running only on that server

That's the normal procedure.

1. If a task failed on a server - how can I stop the entire process
2. In my case, why the playbook continues to run only on the server that was passed the specific task?

You can abort the whole process on a single failure with

  any_errors_fatal: true

Documentation: https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-the-play

Regards
         Racke