title: Ansible - environment variables from .env file
body: <p>I am trying to setup a playbook which will run the command to check status of the service installed in the target machine. The command will only work only if the <code>.env file</code> executed. The command to execute the <code>.env file</code> is <code>.&lt;space&gt;./.env_file_name</code> and the file contains list of environment variables like export <code>JAVA_HOME=/optware/java/jdk/1.2.</code></p>
  
  <p>I tried to execute the environment file before running the command with the below playbook, but it is not working. </p>
  
  <pre><code>- hosts: name
    tasks: 
      - name: `execute env file`
        command: . ./.env_file_name
        register: result
  </code></pre>
  
  <p>Is there any playbook to run the executable environment file to set the environments present on the target machine and then run our command??</p>