title: How to pass variables from one role downstream to other dependency roles with ansible?
body: <p>I have a generic <code>webserver</code> role that is using another <code>nginx</code> role to spawn new vservers.</p>
  
  <p><code>webserver/meta/main.yml</code> looks like:</p>
  
  <pre>
  allow_duplicates: yes
  dependencies:
    - role: nginx
      name: api vserver
      frontend_port: "{{ frontend_port }}"
      domain: "{{ api_domain }}"
      backend_host: 127.0.0.1
    - role: nginx
      name: portal vserver
      domain: "{{ portal_domain }}"
      backend_host: 127.0.0.1
  </pre>
  
  <p>The problem is that these variables are supposed to be defined inside the <code>webserver-role/vars/(test|staging).yml</code></p>
  
  <p>Is seems that Ansible will try to load the dependencies before loading the variables.</p>
  
  <p>How can I solve this problem? I don't want to put any configuration specifics inside the low level roles.</p>
  
  <p>Also, I do not want to put configurations inside the playbook itself because these configurations are shared across multiple playbooks.</p>