Ansible – Create multiple folders if don’t exist

Question:

Goal:

  • 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; http://docs.ansible.com/ansible/stat_module.html. But this only works for a single folder.

Answer:

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