title: Why Ansible facts not available in Roles section?
body: <h1>Question</h1>
  
  <p>Why Ansible facts such as <code>ansible_distribution</code> are not available in Roles section?</p>
  
  <pre><code>---
  - name: Test
    hosts: all
    tasks:
      - name: debug
        debug:
          msg: "{{ ansible_distribution }}" &lt;----- Works
  
    roles:
      - "{{ ansible_distribution }}/somerole" &lt;---- ERROR! 'ansible_distribution' is undefined
  </code></pre>
  
  <h2>ansible.cfg</h2>
  
  <pre><code>[defaults]
  error_on_undefined_vars = True
  </code></pre>