continue execution of tasks on both hosts

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

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
[2] http://docs.ansible.com/playbooks_error_handling.html