<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">include_role</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY / STEPS TO REPRODUCE</h5>
<p dir="auto">When I include a role from another role, the include statement of the included role is not able to find the file. For example:</p>
<p dir="auto">Role A includes role B</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Include other role
  include_role:
    name: roleB"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Include other role</span>
  <span class="pl-ent">include_role</span>:
    <span class="pl-ent">name</span>: <span class="pl-s">roleB</span></pre></div>
<p dir="auto">and role B is split into multiple task files:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Install
  include: install.yml

- name: Configure
  include: configure.yml"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Install</span>
  <span class="pl-ent">include</span>: <span class="pl-s">install.yml</span>

- <span class="pl-ent">name</span>: <span class="pl-s">Configure</span>
  <span class="pl-ent">include</span>: <span class="pl-s">configure.yml</span></pre></div>
<p dir="auto">When role B is directly used from a play everything works fine, but using it from task A failed with '<em>file not found errors</em>'.</p>
<p dir="auto">I have been able to 'fix' this issue by using the <code class="notranslate">role_path</code> variable:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Install
  include: &quot;{{ role_path }}/tasks/install.yml&quot;

- name: Configure
  include: &quot;{{ role_path }}/tasks/configure.yml&quot;"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Install</span>
  <span class="pl-ent">include</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ role_path }}/tasks/install.yml<span class="pl-pds">"</span></span>

- <span class="pl-ent">name</span>: <span class="pl-s">Configure</span>
  <span class="pl-ent">include</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ role_path }}/tasks/configure.yml<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">I was making an ansible-galaxy role today and when placing the lookup_folder plugin at the same level as the rest of the folders and then using it it returns that it can't find the plugin. Do we have anyway to use lookup_plugins at a role level without forcing uses to manually add it to there playbook?</p>
<p dir="auto">Here is the repo in question. Master is how i got it to work for testing that the lookup_plugins folder only works when at the same level as the playbook <a href="https://github.com/nowait-tools/ansible-rabbitmq">https://github.com/nowait-tools/ansible-rabbitmq</a> the branch galaxy test is the one that fails.</p>