# Variable Register: key

**URL:** <https://forum.ansible.com/t/variable-register-key/14950>\
**Category:** Ansible Project\
**Created:** [April 7, 2014, 1:19am UTC](https://forum.ansible.com/t/variable-register-key/14950 "2014-04-07T01:19:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralovely](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@ralovely](https://forum.ansible.com/u/ralovely)\
**Post date:** [April 7, 2014, 1:19am UTC](https://forum.ansible.com/t/variable-register-key/14950/1 "2014-04-07T01:19:03Z")

</div>

Hi list.

I tried, unsuccessfully, to have a register key set to a variable name:

-name: Some other task  
[…]  
vars:

register\_name: a\_specific\_name

- name: The task  
[…]  
register: “{{ register\_name }}”

I imagine the key is not evaluated,  
can someone confirm this ?

Thanks.

raphael.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 9, 2014, 1:35pm UTC](https://forum.ansible.com/t/variable-register-key/14950/2 "2014-04-09T13:35:37Z")

</div>

The value of the variable name you register to must be a string, not a variable.
