Ansible – Create multiple folders if don’t exist



  • Create multiple directories if they don’t exist.
  • Don’t change permissions of existing folder

Current playbook:

The when statement is wrong.

I looked at the example provided; But this only works for a single folder.


Ansible – Creating multiple folders without changing permissions of previously existing.

Working fine for me. Hope this works for you as well just try.

Leave a Reply