<p dir="auto"><b>Issue Type:</b> Feature Idea<br>
<b>Ansible Version:</b> 1.9.1<br>
<b>Ansible Configuration:</b> nothing changed<br>
<b>Environment:</b> RHEL/CentOS 7<br>
<b>Summary:</b><br>
I'm trying to keep some software installed into a non-standard directory. Currently using the yum module I can't specify an alternative installroot path.<br>
<b>Expected Results:</b><br>
I would like to be able to add --installroot option like I can do this with yum in linux.</p>
<p dir="auto"><strong>ISSUE TYPE</strong><br>
Bug Report</p>
<p dir="auto"><strong>COMPONENT NAME</strong><br>
include_role</p>
<p dir="auto"><strong>ANSIBLE VERSION</strong><br>
ansible 2.2.2.0<br>
config file = /etc/ansible/ansible.cfg<br>
configured module search path = Default w/o overrides</p>
<p dir="auto"><strong>CONFIGURATION</strong></p>
<p dir="auto">n/a</p>
<p dir="auto"><strong>OS / ENVIRONMENT</strong></p>
<p dir="auto">Ubuntu</p>
<p dir="auto"><strong>SUMMARY</strong></p>
<p dir="auto">The tasks_from variable is not resolved in the include_role module. However the name variable is resolved</p>
<p dir="auto"><strong>STEPS TO REPRODUCE</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook play.yml --extra-vars &quot;tasks=debug role=test_role&quot;

roles/test_role/tasks/debug.yml
- debug: msg=&quot;debug {{ansible_host}}&quot;

play.yml
- name: test play
  hosts: all
  tasks:
    - debug: msg=&quot;{{tasks}}&quot;
    - include_role:
        name: &quot;{{role}}&quot;
        tasks_from: &quot;{{tasks}}&quot;"><pre class="notranslate"><code class="notranslate">ansible-playbook play.yml --extra-vars "tasks=debug role=test_role"

roles/test_role/tasks/debug.yml
- debug: msg="debug {{ansible_host}}"

play.yml
- name: test play
  hosts: all
  tasks:
    - debug: msg="{{tasks}}"
    - include_role:
        name: "{{role}}"
        tasks_from: "{{tasks}}"
</code></pre></div>
<p dir="auto"><strong>EXPECTED RESULTS</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="xploit@ubuntu:/mnt/hgfs/workspace_/infra/bss$ ansible --version
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
exploit@ubuntu:/mnt/hgfs/workspace_/infra/bss$ ansible-playbook -i inventories/sigfox-local.ini play.yml --extra-vars &quot;tasks=debug role=test_role&quot; 

PLAY [test play] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [debug] *******************************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;debug&quot;
}

TASK [test_role : debug] *******************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;debug localhost&quot;
}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0 "><pre class="notranslate"><code class="notranslate">xploit@ubuntu:/mnt/hgfs/workspace_/infra/bss$ ansible --version
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
exploit@ubuntu:/mnt/hgfs/workspace_/infra/bss$ ansible-playbook -i inventories/sigfox-local.ini play.yml --extra-vars "tasks=debug role=test_role" 

PLAY [test play] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [debug] *******************************************************************
ok: [localhost] =&gt; {
    "msg": "debug"
}

TASK [test_role : debug] *******************************************************
ok: [localhost] =&gt; {
    "msg": "debug localhost"
}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0 
</code></pre></div>
<p dir="auto"><strong>ACTUAL RESULTS</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using /etc/ansible/ansible.cfg as config file
ERROR! Could not find specified file in role: {{tasks}}"><pre class="notranslate"><code class="notranslate">Using /etc/ansible/ansible.cfg as config file
ERROR! Could not find specified file in role: {{tasks}}
</code></pre></div>