# Built-in variable is undefined

**URL:** <https://forum.ansible.com/t/built-in-variable-is-undefined/14375>\
**Category:** Ansible Project\
**Created:** [January 17, 2014, 11:55pm UTC](https://forum.ansible.com/t/built-in-variable-is-undefined/14375 "2014-01-17T23:55:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bilal\_Aslam](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bilal\_Aslam](https://forum.ansible.com/u/Bilal_Aslam)\
**Post date:** [January 17, 2014, 11:55pm UTC](https://forum.ansible.com/t/built-in-variable-is-undefined/14375/1 "2014-01-17T23:55:26Z")

</div>

We have a template which uses the {{ansible\_user\_id}} pre-defined variable. On Ansible 1.5, running against localhost, we see this error:

TASK: [service | Stage deamontools run script] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [127.0.0.1] =\> {‘msg’: “One or more undefined variables: ‘ansible\_user\_id’ is undefined”, ‘failed’: True}  
fatal: [127.0.0.1] =\> {‘msg’: “One or more undefined variables: ‘ansible\_user\_id’ is undefined”, ‘failed’: True}

FATAL: all hosts have already failed – aborting

Is this expected when going against localhost?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [January 18, 2014, 10:46pm UTC](https://forum.ansible.com/t/built-in-variable-is-undefined/14375/2 "2014-01-18T22:46:23Z")

</div>

have you gathered facts? this is what sets the variable.
