new files from source

This commit is contained in:
thesabear committed 2026-06-09 10:20:07 +03:00
commit 973546647d
132 files changed
+5335

No files matched your search

@@ -0,0 +1,82 @@
---
- name: Customize Zsh for users
vars:
zsh_users:
- user
block:
- name: Ensure parent home directory exists (safety)
ansible.builtin.file:
path: "/home/{{ user }}"
state: directory
owner: "{{ user }}"
group: "{{ user }}"
mode: "0755"
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Remove any old oh-my-zsh
ansible.builtin.file:
path: "/home/{{ user }}/.oh-my-zsh"
state: absent
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Clone Oh My Zsh as root
ansible.builtin.git:
repo: "https://github.com/ohmyzsh/ohmyzsh.git"
dest: "/home/{{ user }}/.oh-my-zsh"
version: master
update: yes
force: yes
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Add trusted safe.directory system-wide for Oh My Zsh
ansible.builtin.command:
cmd: git config --system --add safe.directory /home/{{ user }}/.oh-my-zsh
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Install syntax-highlighting plugin
ansible.builtin.git:
repo: "https://github.com/zsh-users/zsh-syntax-highlighting.git"
dest: "/home/{{ user }}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
version: master
update: yes
force: yes
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Deploy customized .zshrc
ansible.builtin.template:
src: zshrc.j2
dest: "/home/{{ user }}/.zshrc"
owner: "{{ user }}"
group: "{{ user }}"
mode: "0644"
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
- name: Fix ownership recursively for Oh My Zsh directory
ansible.builtin.file:
path: "/home/{{ user }}/.oh-my-zsh"
owner: "{{ user }}"
group: "{{ user }}"
recurse: yes
loop: "{{ zsh_users }}"
loop_control:
loop_var: user
become: true
@@ -0,0 +1,21 @@
export ZSH="\$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source \$ZSH/oh-my-zsh.sh
# Where to save history and how much to keep
HISTFILE=~/.zsh_history
HISTSIZE=10000 # In-memory history
SAVEHIST=10000 # Lines to save to file
# Recommended options
setopt APPEND_HISTORY # Don’t overwrite history file; append to it
setopt SHARE_HISTORY # Share history across all sessions
setopt HIST_IGNORE_DUPS # Don’t record duplicate commands
setopt HIST_IGNORE_SPACE # Ignore commands starting with a space
setopt HIST_VERIFY # Edit a command before running from history
setopt INC_APPEND_HISTORY # Write history incrementally as commands are run
PS1='%F{51}%n%F{255}@%F{227}%m %F{84}%~%f %F{15}$ '
fastfetch