<h5 dir="auto">Issue Type:</h5>
<p dir="auto">“Bug Report”</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">v1.5.1-1155-gf09c0c7</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian mix of unstable/testing</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">There was <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="8039248" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/1509" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible/pull/1509/hovercard" href="https://github.com/ansible/ansible/pull/1509">#1509</a> some time ago which presumably resolved similar issues before. Trying in current devel (v1.5.1-1155-gf09c0c7):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$&gt; mkdir venv; virtualenv venv
New python executable in venv/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
$&gt; venv/bin/python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running install
running build
running build_py
running build_scripts
running install_lib
creating /home/yoh/proj/misc/ansible/venv/lib/python2.7/site-packages/ansible
...
running install_scripts
copying build/scripts-2.7/ansible-doc -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-vault -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-pull -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-playbook -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-galaxy -&gt; /home/yoh/proj/misc/ansible/venv/bin
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-doc to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-vault to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-pull to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-playbook to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-galaxy to 755
running install_data
copying ./library/utilities/accelerate -&gt; /usr/share/ansible/utilities
error: could not delete '/usr/share/ansible/utilities/accelerate': Permission denied"><pre class="notranslate"><code class="notranslate">$&gt; mkdir venv; virtualenv venv
New python executable in venv/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
$&gt; venv/bin/python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running install
running build
running build_py
running build_scripts
running install_lib
creating /home/yoh/proj/misc/ansible/venv/lib/python2.7/site-packages/ansible
...
running install_scripts
copying build/scripts-2.7/ansible-doc -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-vault -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-pull -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-playbook -&gt; /home/yoh/proj/misc/ansible/venv/bin
copying build/scripts-2.7/ansible-galaxy -&gt; /home/yoh/proj/misc/ansible/venv/bin
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-doc to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-vault to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-pull to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-playbook to 755
changing mode of /home/yoh/proj/misc/ansible/venv/bin/ansible-galaxy to 755
running install_data
copying ./library/utilities/accelerate -&gt; /usr/share/ansible/utilities
error: could not delete '/usr/share/ansible/utilities/accelerate': Permission denied
</code></pre></div>
<p dir="auto">still tries to deal with '/usr/share'</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">see above</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.4.5</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian 7</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Role vars and role defaults are not available in <code class="notranslate">hostvars</code>.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Consider host <code class="notranslate">a</code> in group <code class="notranslate">appservers</code>. If host <code class="notranslate">a</code> has role <code class="notranslate">foo</code> and this role has some variable in <code class="notranslate">roles/foo/defaults/main.yml</code> or <code class="notranslate">roles/foo/vars/main.yml</code> then this role is not available in <code class="notranslate">hostvars</code> during the following iteration:</p>
<div class="highlight highlight-text-html-django notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{% for host in groups['appservers'] %}
        {{ hostvars[host]|to_nice_json }}
    {% endfor %}"><pre class="notranslate"><span class="pl-e">{%</span> <span class="pl-k">for</span> <span class="pl-s">host</span> <span class="pl-k">in</span> <span class="pl-s">groups</span>[<span class="pl-s">'appservers'</span>] <span class="pl-e">%}</span>
        {{ hostvars[hos<span class="pl-smi">t]</span>|to_nice_json }}
    <span class="pl-e">{%</span> <span class="pl-k">endfor</span> <span class="pl-e">%}</span></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Variable is available in hostvars</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">Variable is missing in hostvars</p>