# continue execution of tasks on both hosts

**URL:** <https://forum.ansible.com/t/continue-execution-of-tasks-on-both-hosts/24268>\
**Category:** Ansible Project\
**Created:** [April 20, 2017, 5:16pm UTC](https://forum.ansible.com/t/continue-execution-of-tasks-on-both-hosts/24268 "2017-04-20T17:16:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Recchia](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Robert\_Recchia](https://forum.ansible.com/u/Robert_Recchia)\
**Post date:** [April 20, 2017, 5:16pm UTC](https://forum.ansible.com/t/continue-execution-of-tasks-on-both-hosts/24268/1 "2017-04-20T17:16:08Z")

</div>

I am creating a playbook that is used for multiple hosts - now this might not be the best way but I still want to figure it out. I have two hosts now one that is centos 7 and one that is in amazon ec2. Obviously one uses systemd and the other does not. All the tasks apply to both hosts except for the stopping of firewalld

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 20, 2017, 5:29pm UTC](https://forum.ansible.com/t/continue-execution-of-tasks-on-both-hosts/24268/2 "2017-04-20T17:29:44Z")

</div>

> I am creating a playbook that is used for multiple hosts - now this might  
> not be the best way but I still want to figure it out. I have two hosts  
> now one that is centos 7 and one that is in amazon ec2. Obviously one uses  
> systemd and the other does not. All the tasks apply to both hosts except  
> for the stopping of firewalld

\<snip\>

> and of course nothing for the amazon ec2 instance. How can I keep the  
> tasks running on the failed host.

Use when: [1] on the task to only run it on appropriate host or set ignore\_errors: yes [2] on the task.

[1] [https://docs.ansible.com/ansible/playbooks\_conditionals.html](https://docs.ansible.com/ansible/playbooks_conditionals.html)  
[2] [http://docs.ansible.com/playbooks\_error\_handling.html](http://docs.ansible.com/playbooks_error_handling.html)
