Files
configs/playbooks/roles/software_tmux/tasks/main.yml
2024-10-09 21:25:58 +02:00

46 lines
1.0 KiB
YAML

---
- name: Copy config
tags:
- config
become: "{{ use_become }}"
ansible.builtin.file:
mode: "{{ item.mode }}"
path: "{{ home }}/{{ item.path }}"
owner: "{{ username }}"
state: directory
with_community.general.filetree:
- ../files
loop_control:
label: "{{ item.path }}"
when: item.state == 'directory'
- name: "Copy templates"
tags:
- config
become: "{{ use_become }}"
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "{{ item.mode }}"
owner: "{{ username }}"
with_community.general.filetree:
- ../templates
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'
- name: Copy config
tags:
- config
become: "{{ use_become }}"
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ home }}/{{ item.path }}"
mode: "{{ item.mode }}"
owner: "{{ username }}"
with_community.general.filetree:
- ../files
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'