# create folder with an incremental suffix automatically if folder already exist

**URL:** <https://forum.ansible.com/t/create-folder-with-an-incremental-suffix-automatically-if-folder-already-exist/34573>\
**Category:** Ansible Developer\
**Created:** [February 5, 2021, 5:55am UTC](https://forum.ansible.com/t/create-folder-with-an-incremental-suffix-automatically-if-folder-already-exist/34573 "2021-02-05T05:55:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_ragunath](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@rohit\_ragunath](https://forum.ansible.com/u/rohit_ragunath)\
**Post date:** [February 5, 2021, 5:55am UTC](https://forum.ansible.com/t/create-folder-with-an-incremental-suffix-automatically-if-folder-already-exist/34573/1 "2021-02-05T05:55:30Z")

</div>

Hi Team,

I came across a scenario, when a folder should be created with a suffix appended in incremental order.  
For example: if the Directory /Sample/Test dir already exist and if the path is /Sample/Test, then a directory /Sample/Test1 will be created. On subsequent run the number keeps increasing.  
Thought of adding a new attribute **impose\_suffix,** if set to True to achieve the above.

Just wanted to check if this is something that we can consider as change request or if its a common scenario that can be generalized to make it a feature.

Raised a PR for the same : [https://github.com/ansible/ansible/pull/73435](https://github.com/ansible/ansible/pull/73435)

Please let me know your thoughts.

Regards  
Rohit
