--- - name: Check if service directories exist ansible.builtin.stat: path: "{{ btrfs_base_path }}/{{ service_name }}/{{ service_dir }}" loop: "{{ service_directories }}" loop_control: label: "{{ service_name }}/{{ service_dir }}" loop_var: service_dir register: directory_stats - name: Create service directories in BTRFS subvolume (only if they don't exist) ansible.builtin.file: path: "{{ btrfs_base_path }}/{{ service_name }}/{{ dir_stat.service_dir }}" state: directory owner: "{{ service_name }}" group: "{{ service_name }}" mode: '0755' loop: "{{ directory_stats.results }}" loop_control: loop_var: dir_stat when: not dir_stat.stat.exists