# I stuck with make many files from template

**URL:** <https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367>\
**Category:** Ansible Project\
**Created:** [June 1, 2015, 11:27am UTC](https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367 "2015-06-01T11:27:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user64](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@user64](https://forum.ansible.com/u/user64)\
**Post date:** [June 1, 2015, 11:27am UTC](https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367/1 "2015-06-01T11:27:32Z")

</div>

Hello. I develop role for make conf’s OpenVPN server/client side. I need minimum two OpenVPN tunnels on each router. I don’t found the way for deploy more then one conf’s.

Pushed for test [https://github.com/k0ste/ansible-role-openvpn](https://github.com/k0ste/ansible-role-openvpn)

Try it, start playbook as is and see, ansible can create many files from template, **but inside file is identical for all list** (openvpn\_server/openvpn\_client);

Any ideas?

P.S.: sorry 4 bad English.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [June 1, 2015, 2:28pm UTC](https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367/2 "2015-06-01T14:28:05Z")

</div>

Hi, based on your use-case I believe with\_dict would be more useful to you than with\_flattened, as the later is mainly used to flatten multiple lists into a single list.

---

<div class="post-metadata">

**Author:** ![user64](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@user64](https://forum.ansible.com/u/user64)\
**Post date:** [June 2, 2015, 5:52am UTC](https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367/3 "2015-06-02T05:52:04Z")

</div>

I try with\_dict, the same. I rewrite role for test it [https://github.com/k0ste/ansible-role-openvpn-dict](https://github.com/k0ste/ansible-role-openvpn-dict)

If I do poorly explained - need to stop the execution of the file, after params for openvpn1 is reached, and start the new file.

`  
openvpn\_dict:  
openvpn1:  
params  
openvpn2:  
params

`

---

<div class="post-metadata">

**Author:** ![user64](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@user64](https://forum.ansible.com/u/user64)\
**Post date:** [October 15, 2015, 12:26pm UTC](https://forum.ansible.com/t/i-stuck-with-make-many-files-from-template/18367/4 "2015-10-15T12:26:50Z")

</div>

I did it. Role on [github](https://github.com/k0ste/ansible-role-openvpn-ldap).
