title: Ansible: Best practice to connect roles (meta, rolename: or import_role)
body: <p>There are three ways (as far as I know) to invoke another role:</p>
  
  <p>1)  In a playbook with <code>role: rolename</code></p>
  
  <p>2)  In the role itself within the <em>rolename/meta/main.yml</em>-file with </p>
  
  <pre><code>dependencies:
    - { role: rolename2 }
  </code></pre>
  
  <p>3)  </p>
  
  <pre><code>- import_role:
      name: anotherrolename
  </code></pre>
  
  <p>I guess I also know the differences: 
  No. 2 (meta-methode) will <em>rolname2</em> execute before the things specified in tasks. 
  No. 3 = <a href="https://docs.ansible.com/ansible/2.4/import_role_module.html" rel="nofollow noreferrer">https://docs.ansible.com/ansible/2.4/import_role_module.html</a></p>
  
  <p>My question in the first place is not the difference between these methods (feel free to let us know) but I’d like to know what’s the best practice to connect two (or more) roles. Method 1, 2 or 3?</p>