# error in templating jinja replace "." with nothing

**URL:** <https://forum.ansible.com/t/error-in-templating-jinja-replace-with-nothing/20992>\
**Category:** Ansible Project\
**Created:** [March 26, 2016, 6:00pm UTC](https://forum.ansible.com/t/error-in-templating-jinja-replace-with-nothing/20992 "2016-03-26T18:00:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meher\_Garda](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Meher\_Garda](https://forum.ansible.com/u/Meher_Garda)\
**Post date:** [March 26, 2016, 6:00pm UTC](https://forum.ansible.com/t/error-in-templating-jinja-replace-with-nothing/20992/1 "2016-03-26T18:00:28Z")

</div>

In my default folder , main.yml I have the following

percona\_version: 5.6  
percona\_pckg\_version: “{% {{percona\_version}}|replace(‘.’, ‘’) %}” # want to remove the period in 5.6 so as to get 56

The above gives error while running playbook

fatal: [x.x.x.x] =\> Failed to template {{percona\_pckg\_version}}: Failed to template {% percona\_version|replace(‘.’, ‘’) %}: template error while templating string: Encountered unknown tag ‘percona\_version’.

Any ideas?

---

<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:** [March 27, 2016, 4:18pm UTC](https://forum.ansible.com/t/error-in-templating-jinja-replace-with-nothing/20992/2 "2016-03-27T16:18:10Z")

</div>

What you want is something like:

percona\_pckg\_version: “{{ percona\_version|replace(‘.’, ‘’) }}”

You might want to read up on jinja2 a little at [http://jinja.pocoo.org/docs/dev/templates/](http://jinja.pocoo.org/docs/dev/templates/)

{% %} are used for control structures such as `for` and `if`, where as {{ }} are used to denote “expressions to print”
