How to get environment variables of remote host
<p>I am having problems working with the environment variables of a remote host. For example, when I try {{ lookup('env', 'PATH') }} this returns the path of my guest machine not of the remote host.</p>

<p>How to pick up / change environment variables of the remote host?</p>

<p>my playbook :</p>

<pre><code>---
- name : playbook
  hosts : webservers
  gather_facts: yes
  remote_user: user1
  vars:
   Path: "{{lookup('ansible_env','PATH')}}"
  roles :
 - task1
 - task2 
 - task3 
</code></pre>

<p>that's return the path of my machine not the path of remote host named user1 i'm a beginner in ansible need some help . thank you in advance.</p>