title: Ansible run command with an updated PATH
body: <p>I'm doing the following:</p>
  
  <pre><code>  tasks:
  - name: Output env vars
    shell: echo $PATH $ANDROID_HOME &gt; path.txt
    environment:
      ANDROID_HOME: "/home/{{ deploy_user }}/android-sdk-linux"
      PATH: "{{ ansible_env.ANDROID_HOME }} /tools:/platform-tools:{{ ansible_env.PATH }}"
  </code></pre>
  
  <p>The output on the server is:</p>
  
  <pre><code>$ less path.txt
   {{ ansible_env.ANDROID_HOME }}/tools:/platform-tools:{{ ansible_env.PATH }} /home/azureuser/android-sdk-linux}}
  </code></pre>
  
  <p>It seems that the string is not interpolated.</p>
  
  <p>Exactly the same playbook with the task:</p>
  
  <pre><code>  tasks:
  - name: Output $PATH
    shell: echo $PATH $ANDROID_HOME &gt; path.txt
    environment:
      ANDROID_HOME: "/home/{{ deploy_user }}/android-sdk-linux"
      PATH: "/tools:/platform-tools:{{ ansible_env.PATH }}"
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>$ less path.txt
    /tools:/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games /home/azureuser/android-sdk-linux
  </code></pre>
  
  <p>which is what I expected.</p>