# \[WARNING\]: "register" is not templatable, but we found:

**URL:** <https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759>\
**Category:** Ansible Project\
**Created:** [April 22, 2020, 4:07pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759 "2020-04-22T16:07:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_HENSSEN](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@Laurent\_HENSSEN](https://forum.ansible.com/u/Laurent_HENSSEN)\
**Post date:** [April 22, 2020, 4:07pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759/1 "2020-04-22T16:07:32Z")

</div>

Hello,

I’m trying to register a var through a dynamical use of “register” (I mean : using a var, like : register: {{ var }}).

Dev updated the code and removed this option (now static only).  
I’m not able to find more information about that change and also there is nobody connected on the IRC so, I post here.

Bug report (closed without real details) :  
[https://github.com/ansible/ansible/issues/57839](https://github.com/ansible/ansible/issues/57839)

Code change :  
[https://gitlab.ics.muni.cz/242618/ansible/commit/be776daefed047f0bd45d7441efde046677fd417](https://gitlab.ics.muni.cz/242618/ansible/commit/be776daefed047f0bd45d7441efde046677fd417)

The very detailed comment about that (from the bug report) :

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 22, 2020, 4:18pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759/2 "2020-04-22T16:18:57Z")

</div>

> Hello,
> 
> I'm trying to register a var through a dynamical use of "register" (I mean : using a var, like : register: {{ var }}).
> 
> Dev updated the code and removed this option (now static only).  
> I'm not able to find more information about that change and also there is nobody connected on the IRC so, I post here.

It was likely never documented. You can append a "set\_fact" task to alleviate that.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Laurent\_HENSSEN](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@Laurent\_HENSSEN](https://forum.ansible.com/u/Laurent_HENSSEN)\
**Post date:** [April 22, 2020, 4:21pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759/3 "2020-04-22T16:21:17Z")

</div>

Let me add a quick update :

- I’m trying to process several paths
- paths are grouped and so, there are several “list” of paths (because need to generate from template and it’s different regarding the list)
- objective was to use an compact / easier code (instead of copy existing task for a new list, just use kind of “function” … = include and loop)

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [April 22, 2020, 4:28pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759/4 "2020-04-22T16:28:18Z")

</div>

`register` has never been templatable. Previously it would create a literal variable called `{{ var }}` which included the brackets.

When looping and using register, see [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_loops.html#registering-variables-with-a-loop](https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#registering-variables-with-a-loop)

---

<div class="post-metadata">

**Author:** ![Laurent\_HENSSEN](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@Laurent\_HENSSEN](https://forum.ansible.com/u/Laurent_HENSSEN)\
**Post date:** [April 22, 2020, 5:45pm UTC](https://forum.ansible.com/t/warning-register-is-not-templatable-but-we-found/32759/5 "2020-04-22T17:45:49Z")

</div>

Interesting, I also just found that.

I did try that :
