# OpenStack heat template syntax

**URL:** <https://forum.ansible.com/t/openstack-heat-template-syntax/17541>\
**Category:** Ansible Project\
**Created:** [February 18, 2015, 12:55am UTC](https://forum.ansible.com/t/openstack-heat-template-syntax/17541 "2015-02-18T00:55:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hce](https://avatars.discourse-cdn.com/v4/letter/h/c0e974/32.png) [@hce](https://forum.ansible.com/u/hce)\
**Post date:** [February 18, 2015, 12:55am UTC](https://forum.ansible.com/t/openstack-heat-template-syntax/17541/1 "2015-02-18T00:55:23Z")

</div>

Hi,

I am using OpenStack Heat template to generate vms, does anyone know how to increase numerical index?

According to the heat document, the numerical index can be used in the template:

```auto
name: my_server_%index%

```

```auto
How can I add one to the index number like following one (but that is not correct syntax)?

```

```auto
name: my_server_{{ %index% + 1 }}

```

```auto
Thanks.

- j

```

![](https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 18, 2015, 2:45am UTC](https://forum.ansible.com/t/openstack-heat-template-syntax/17541/2 "2015-02-18T02:45:57Z")

</div>

you might want to use with\_sequence

---

<div class="post-metadata">

**Author:** ![hce](https://avatars.discourse-cdn.com/v4/letter/h/c0e974/32.png) [@hce](https://forum.ansible.com/u/hce)\
**Post date:** [February 19, 2015, 4:32am UTC](https://forum.ansible.com/t/openstack-heat-template-syntax/17541/3 "2015-02-19T04:32:21Z")

</div>

Could you give an example how to run with\_sequence in following heat template? The HOT template syntax is different to ansible template.

heat\_HOT.yml:

…

```auto
name: my_server_%index%

```

…
