In my Ansible playbook many times i need to create a file:
- name: Copy file
template:
src: code.conf.j2
dest: "{{ project_root }}/conf/code.conf"
Many times conf
dir is not there. Then I have to create another task to create that dir first.
Is there any easy way to auto create the dir if it doesn't exist with some option?