Add shared bat dotfiles and cache refresh task

This commit is contained in:
Fabio Scotto di Santolo
2026-03-17 09:52:01 +01:00
parent 3337e99991
commit 4f0101cdc6
7 changed files with 8240 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ user_shell: /bin/bash
common_packages:
- bash-completion
- bat
- git
- wget
- unzip
@@ -23,3 +24,7 @@ common_dotfiles:
src: .bash_profile
dest: .bash_profile
mode: "0644"
- name: bat config
src: .config/bat/.config/bat/
dest: .config/bat/
mode: preserve

View File

@@ -1,4 +1,9 @@
---
- name: Ensure bat package is installed
ansible.builtin.package:
name: bat
state: present
- name: Copy common dotfiles
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}"
@@ -9,3 +14,11 @@
loop: "{{ common_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
- name: Refresh bat cache
ansible.builtin.command:
cmd: "{{ 'batcat' if ansible_facts.os_family == 'Debian' else 'bat' }} cache --build"
become_user: "{{ username }}"
environment:
HOME: "{{ user_home }}"
changed_when: false