--- - name: Creates config directory if needed become: true ansible.builtin.file: path: "{{ swayusr.home }}/.config" state: directory mode: '0750' owner: "{{ swayusr.user }}" group: "{{ swayusr.user }}" loop: "{{ sway__user_list | flatten(1) }}" loop_control: loop_var: swayusr label: "{{ swayusr.home }}/.config/" - name: Create sway config folder become: true ansible.builtin.file: path: "{{ swayusr.home }}/.config/sway/" state: directory mode: '0750' owner: "{{ swayusr.user }}" group: "{{ swayusr.user }}" loop: "{{ sway__user_list | flatten(1) }}" loop_control: loop_var: swayusr label: "{{ swayusr.home }}/.config/sway/" - name: Create sway dynamic names ansible.builtin.include_tasks: file: "dynamic_names.yml" loop: "{{ sway__user_list | flatten(1) }}" loop_control: loop_var: swayusr label: "{{ swayusr.home }}/.config/sway/" when: sway__dynamic_names | bool - name: Creates swaylock config directory if needed become: true ansible.builtin.file: path: "{{ swayusr.home }}/.swaylock" state: directory mode: '0750' owner: "{{ swayusr.user }}" group: "{{ swayusr.user }}" loop: "{{ sway__user_list | flatten(1) }}" loop_control: loop_var: swayusr label: "{{ swayusr.home }}/.swaylock" - name: Deploy swaylock config file become: true ansible.builtin.template: src: 'templates/swaylock.j2' dest: "{{ swayusr.home }}/.swaylock/config" mode: '0640' owner: "{{ swayusr.user }}" group: "{{ swayusr.user }}" backup: true loop: "{{ sway__user_list | flatten(1) }}" loop_control: label: "{{ swayusr.home }}/.swaylock/config" loop_var: swayusr - name: Deploy sway config file become: true ansible.builtin.template: src: 'templates/config.j2' dest: "{{ swayusr.home }}/.config/sway/config" mode: '0640' owner: "{{ swayusr.user }}" group: "{{ swayusr.user }}" backup: true loop: "{{ sway__user_list | flatten(1) }}" loop_control: label: "{{ swayusr.home }}/.config/sway/config" loop_var: swayusr