title: Ansible env variable differs for sudo user
body: <p>The issue we are facing is around environment variables. The <code>JAVA_HOME</code> is set to 1.5 for a user A and for root it is set to 1.7. When I login manually &amp; check the versions in both A &amp; root, it reflects the same.</p>
  
  <p>When I SSH through ansible as user A with sudo set to true (<code>sudo_user=root</code>), I expected the java version to be 1.7 but it came back as 1.5, which is the version of user A.</p>
  
  <p>Any ideas why things behave differently between manual login &amp; ansible login? </p>