Files
configs/playbooks/roles/software_zsh/tasks/main.yml
2024-10-08 08:07:44 +02:00

55 lines
1.1 KiB
YAML

---
- name: Install core dependencies
tags:
- install
ansible.builtin.package:
name:
- zsh
- name: Set shell
become: true
tags:
- config
ansible.builtin.user:
name: "{{ username }}"
shell: /usr/bin/zsh
- name: Copy config
tags:
- config
ansible.builtin.file:
mode: "{{ item.mode }}"
path: "{{ home }}/{{ item.path }}"
state: directory
with_community.general.filetree:
- ../files
loop_control:
label: "{{ item.path }}"
when: item.state == 'directory'
- name: "Copy templates"
tags:
- config
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "{{ item.mode }}"
with_community.general.filetree:
- ../templates
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'
- name: Copy config
tags:
- config
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ home }}/{{ item.path }}"
mode: "{{ item.mode }}"
with_community.general.filetree:
- ../files
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'