title: Ansible - /etc/profile.d scripts
body: <p>I defined a <code>envs.sh</code> script inside the <code>/etc/profile.d/</code> folder.
  When executing a <code>ansible-playbook</code>, I'm trying to get the value of this env var but it instead throws me an error:</p>
  
  <p>Ansible test:</p>
  
  <pre><code>debug: msg="{{ ansible_env.NGN_VAL }} is an environment variable"
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>fatal: [xxx.yyy.zzz.kkk] =&gt; One or more undefined variables: 'dict object' has no attribute 'NGN_VAL'
  
  FATAL: all hosts have already failed -- aborting
  </code></pre>
  
  <p>Why it doesn't execute the scripts inside that folder? When I connect through <code>ssh</code>, I echo it and it displays its value. How do I set remote environment variables and obtain them during ansible execution?</p>
  
  <p>Thanks</p>