added several ansible roles

This commit is contained in:
2024-02-25 21:16:00 +01:00
parent 0569464dbc
commit 0506eb2665
26 changed files with 652 additions and 13 deletions

View File

@@ -0,0 +1,30 @@
- name: Install bat
community.general.cargo:
name: bat
path: '{{ ansible_user_dir }}/.cargo'
state: latest
locked: true
executable: /usr/bin/cargo
- name: Create required folders
file:
state: directory
dest: "{{ lookup('env', 'XDG_CONFIG_HOME') }}/{{ item.path }}"
with_filetree: ../templates
when: item.state == 'directory'
- name: Install bat config files
template:
src: "{{ item.src }}"
dest: "{{ lookup('env', 'XDG_CONFIG_HOME') }}/bat/{{ item.path }}"
owner: "{{ ansible_user_uid }}"
group: "{{ ansible_user_gid }}"
mode: '{{ item.mode }}'
with_filetree: templates/bat/
- name: Add to .zshrc
lineinfile:
path: "{{ ansible_user_dir }}/.zshrc"
insertafter: '\[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}.* \] && source {{ lookup("env", "XDG_CONFIG_HOME") }}.*'
regexp: '\[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}/bat/bat\.rc \] && source {{ lookup("env", "XDG_CONFIG_HOME") }}/bat/bat\.rc'
line: '[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}/bat/bat.rc ] && source {{ lookup("env", "XDG_CONFIG_HOME") }}/bat/bat.rc'

View File

@@ -0,0 +1 @@
alias cat='bat --paging=never'