# Random var and lenguage reference

**URL:** <https://forum.ansible.com/t/random-var-and-lenguage-reference/25817>\
**Category:** Ansible Project\
**Created:** [October 25, 2017, 12:14pm UTC](https://forum.ansible.com/t/random-var-and-lenguage-reference/25817 "2017-10-25T12:14:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrvilda](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@jrvilda](https://forum.ansible.com/u/jrvilda)\
**Post date:** [October 25, 2017, 12:14pm UTC](https://forum.ansible.com/t/random-var-and-lenguage-reference/25817/1 "2017-10-25T12:14:36Z")

</div>

Hi,

I would like to get a 3 digit random number, for example 001.  
I have come to get:

tasks:

- name: We assign a fixed random variable throughout the execution.  
set\_fact:  
Random\_Fix: “{{ 100 | random }}”  
run\_once: yes

¿Which language uses “{{100 | random}}” or where can I find reference for this language?

I have been listening for a long time how easy it is to work with ansible, but at the moment it is not being.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 25, 2017, 6:25pm UTC](https://forum.ansible.com/t/random-var-and-lenguage-reference/25817/2 "2017-10-25T18:25:28Z")

</div>

In Ansible {{ }} indicate templating, "language" is Jinja[1].  
Ansible extend Jinja with some custom filters[2] and replaces some of the default filters in Jinja, random is such a filter.

[1] jinja.pocoo.org/docs/dev/templates/  
[2] [https://docs.ansible.com/ansible/latest/playbooks\_filters.html](https://docs.ansible.com/ansible/latest/playbooks_filters.html)
