<p dir="auto">it appears we are not running the sudo variable through the template engine per a mailing list post, and we should, so that behavior can be passed in via -e like everything else.</p>
<p dir="auto">In the vein of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="10796075" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/2032" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/2032/hovercard" href="https://github.com/ansible/ansible/issues/2032">#2032</a> sudo_user: can't be set as a variable loaded from vars_files.</p>
<p dir="auto">For example in playbook.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: bitarena
  vars_files:
    - ../vars/general.yml
  user: $sys_user
  sudo_user: $sudo_user_db"><pre class="notranslate"><code class="notranslate">
---
- hosts: bitarena
  vars_files:
    - ../vars/general.yml
  user: $sys_user
  sudo_user: $sudo_user_db
</code></pre></div>
<p dir="auto">Connection log</p>
<blockquote>
<p dir="auto"> ESTABLISH CONNECTION FOR USER: ansiblemgr on PORT 22 TO bitarena<br>
 EXEC /bin/sh -c 'mkdir -p /tmp/ansible-1364316856.83-103086297282724 &amp;&amp; chmod a+rx /tmp/ansible-1364316856.83-103086297282724 &amp;&amp; echo /tmp/ansible-1364316856.83-103086297282724'<br>
 REMOTE_MODULE setup<br>
 PUT /tmp/tmpA3E09G TO /tmp/ansible-1364316856.83-103086297282724/setup<br>
 EXEC /bin/sh -c 'chmod a+r /tmp/ansible-1364316856.83-103086297282724/setup'<br>
 EXEC /bin/sh -c 'sudo -k &amp;&amp; sudo -H -S -p "[sudo via ansible, key=oiokygakeauprdjzkhpyvbfztvactecp] password: " -u $sudo_user_db /bin/sh -c '"'"' /usr/bin/python /tmp/ansible-1364316856.83-103086297282724/setup; rm -rf /tmp/ansible-1364316856.83-103086297282724/ &gt;/dev/null 2&gt;&amp;1'"'"''<br>
fatal: [bitarena] =&gt; ssh connection closed waiting for password prompt</p>
</blockquote>