title: How to structure a template file which might be different for groups of hosts in Ansible?
body: <p>I have a template file <code>iptables.j2</code> which contains a few core rules (e.g. allowing SSH connections). However depending on the role of a node, that template will contain additional rules which cannot be managed using variables. e.g. mongo nodes will need to open port 27000 and nginx nodes ports 80 &amp; 443 etc..</p>
  
  <p>Are there examples of conditional includes of extra content into a base template that can solve my problem ?</p>