mirror of
https://github.com/roles-ansible/ansible_role_i3wm.git
synced 2024-08-16 10:09:53 +02:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
---
|
|
- 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: 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 }}"
|
|
loop: "{{ sway__user_list | flatten(1) }}"
|
|
loop_control:
|
|
label: "{{ swayusr.home }}/.config/sway/config"
|
|
loop_var: swayusr
|