# Use the version of the role as variable in a template

**URL:** <https://forum.ansible.com/t/use-the-version-of-the-role-as-variable-in-a-template/30148>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [April 18, 2019, 4:29pm UTC](https://forum.ansible.com/t/use-the-version-of-the-role-as-variable-in-a-template/30148 "2019-04-18T16:29:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Werner\_Dijkerman](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@Werner\_Dijkerman](https://forum.ansible.com/u/Werner_Dijkerman)\
**Post date:** [April 18, 2019, 4:29pm UTC](https://forum.ansible.com/t/use-the-version-of-the-role-as-variable-in-a-template/30148/1 "2019-04-18T16:29:36Z")

</div>

Hi,

I’m curious if there is a Ansible variable available that I can use that describes the version of a role.

In a requirements.yml file, like the following:

`

- src: dj-wasabi.zabbix-server  
version: 1.4.0

`

A version can be configured and when executing the ansible-galaxy command it downloads that version of the role.  
But is there also a way in a playbook that I can use this value (1.4.0) in a template that I can install on my target?

What I want to do, is with the last task in my role, to create a file on the target with that value. I can then see what version was deployed the last time and if a new execution of the role is needed.

Maybe I’m using the wrong keywords, but could not find an answer in this google group or web.

Kind regards,  
Werner
