How to properly structure my ansible playbook when sharing tasks between roles
<p>I am trying to follow best pratices in designing my ansible playbook. So the playbook file itself looks like this:</p>

<pre><code>- hosts: ...
roles:
 - dbservers
 - webservers
 - ...
</code></pre>

<p>Now there is a task <code>check_proxy_and_firewalls</code> that I want to execute in the <code>dbserers</code> as well as in <code>webservers</code> roles.</p>

<p>How would I properly structure that? All the "best_practice" guides I find do not seem to consider this case.</p>

<p>I could simple add a file <code>common_tasks/check_proxy_and_firewalls.yml</code> and include it in the roles where I need this. Is that how to do it?</p>