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

**URL:** <https://forum.ansible.com/t/after-failed-task-on-99-of-my-server-the-rest-of-the-playbook-is-running-only-on-the-1-servers-that-passed-the-tasks/32730>\
**Category:** Ansible Project\
**Created:** [April 20, 2020, 6:33am UTC](https://forum.ansible.com/t/after-failed-task-on-99-of-my-server-the-rest-of-the-playbook-is-running-only-on-the-1-servers-that-passed-the-tasks/32730 "2020-04-20T06:33:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudu.c](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@dudu.c](https://forum.ansible.com/u/dudu.c)\
**Post date:** [April 20, 2020, 6:33am UTC](https://forum.ansible.com/t/after-failed-task-on-99-of-my-server-the-rest-of-the-playbook-is-running-only-on-the-1-servers-that-passed-the-tasks/32730/1 "2020-04-20T06:33:54Z")

</div>

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?

```auto
- 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

```

```auto
    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

```

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 20, 2020, 6:52am UTC](https://forum.ansible.com/t/after-failed-task-on-99-of-my-server-the-rest-of-the-playbook-is-running-only-on-the-1-servers-that-passed-the-tasks/32730/2 "2020-04-20T06:52:41Z")

</div>

> 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

&nbsp;&nbsp;any\_errors\_fatal: true

Documentation: [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_error\_handling.html#aborting-the-play](https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-the-play)

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
