2021-11-08 12:28:11 +01:00
|
|
|
---
|
2024-07-17 15:45:32 +02:00
|
|
|
- name: Creates config directory if needed
|
2021-11-08 12:28:11 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
2024-07-17 15:45:32 +02:00
|
|
|
path: "{{ swayusr.home }}/.config"
|
2021-11-08 12:28:11 +01:00
|
|
|
state: directory
|
2024-07-17 15:45:32 +02:00
|
|
|
mode: '0750'
|
|
|
|
owner: "{{ swayusr.user }}"
|
|
|
|
group: "{{ swayusr.user }}"
|
|
|
|
loop: "{{ sway__user_list | flatten(1) }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: swayusr
|
2024-07-18 13:23:54 +02:00
|
|
|
label: "{{ swayusr.home }}/.config/"
|
2021-11-08 12:28:11 +01:00
|
|
|
|
2024-07-17 15:45:32 +02:00
|
|
|
- name: Create sway config folder
|
2021-11-15 00:28:35 +01:00
|
|
|
become: true
|
2021-11-08 19:30:22 +01:00
|
|
|
ansible.builtin.file:
|
2024-07-17 15:45:32 +02:00
|
|
|
path: "{{ swayusr.home }}/.config/sway/"
|
2021-11-08 19:30:22 +01:00
|
|
|
state: directory
|
2023-08-01 22:13:23 +02:00
|
|
|
mode: '0750'
|
2024-07-17 15:45:32 +02:00
|
|
|
owner: "{{ swayusr.user }}"
|
|
|
|
group: "{{ swayusr.user }}"
|
|
|
|
loop: "{{ sway__user_list | flatten(1) }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: swayusr
|
2024-07-18 13:23:54 +02:00
|
|
|
label: "{{ swayusr.home }}/.config/sway/"
|
2024-07-17 15:45:32 +02:00
|
|
|
|
|
|
|
- name: Create sway dynamic names
|
|
|
|
ansible.builtin.include_tasks:
|
|
|
|
file: "dynamic_names.yml"
|
|
|
|
loop: "{{ sway__user_list | flatten(1) }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: swayusr
|
2024-07-18 13:23:54 +02:00
|
|
|
label: "{{ swayusr.home }}/.config/sway/"
|
2024-07-17 15:45:32 +02:00
|
|
|
when: sway__dynamic_names | bool
|
|
|
|
|
|
|
|
- name: Deploy sway config file
|
2021-11-08 12:28:11 +01:00
|
|
|
become: true
|
2023-08-01 22:13:23 +02:00
|
|
|
ansible.builtin.template:
|
2024-07-17 15:45:32 +02:00
|
|
|
src: 'templates/config.j2'
|
|
|
|
dest: "{{ swayusr.home }}/.config/sway/config"
|
|
|
|
mode: '0640'
|
|
|
|
owner: "{{ swayusr.user }}"
|
|
|
|
group: "{{ swayusr.user }}"
|
|
|
|
loop: "{{ sway__user_list | flatten(1) }}"
|
|
|
|
loop_control:
|
2024-07-18 13:23:54 +02:00
|
|
|
label: "{{ swayusr.home }}/.config/sway/config"
|
2024-07-17 15:45:32 +02:00
|
|
|
loop_var: swayusr
|