On 4/20/20 8:33 AM, דודו דודו wrote:
> 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

> 
> 
> - 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
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to
> [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/384caf13-5c89-4edd-acbf-f10b70312f68%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/384caf13-5c89-4edd-acbf-f10b70312f68%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a3d991c5-5fdc-f371-d52d-0f0fb6e5e3ea%40linuxia.de.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to