title: Ansible - multiple roles
body: <p>I am trying to run multiple roles using <code>with_items</code> command, however I am getting error:</p>
  
  <blockquote>
    <p>"ERROR! 'item' is undefined"</p>
  </blockquote>
  
  <p><code>role.yml</code>:</p>
  
  <pre><code>---
  - hosts: '{{ host }}'
    become: yes
  
    roles:
      - role: "{{item}}"
        with_items: "{{ roles }}"
  </code></pre>
  
  <p>Here is my command:</p>
  
  <pre><code>ansible-playbook -i ./inventory/Dev ./playbooks/role.yml --extra-vars='{"host": "db", "roles": ["mysql", "apache"]}'
  </code></pre>