Files
ansible-repo/playbooks/software/zsh/deploy-zsh.yml
hogweed1 a06bc8d53e
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
well,
2026-11-10 21:05:11 +10:00

96 lines
3.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: "Этап 2: Деплой ZSH + OMZ + P10k"
hosts: all
become: yes
vars:
# Укажи здесь root и своего основного пользователя
zsh_users:
- "root"
- "hogweed1"
# Вставь сюда сгенерированный токен из Gitea
gitea_token: "0e2d23940d1862ae1558476f39565cd5bb2bcd88"
# Базовый адрес твоей организации/юзера в Gitea (БЕЗ http://)
gitea_base: "git.guaranteedstruggle.host/hackerspace"
# Формируем ссылки с токеном. В таком формате Git пролетает авторизацию без вопросов
repo_omz: "https://{{ gitea_token }}@{{ gitea_base }}/ohmyzsh_mirror.git"
repo_p10k: "https://{{ gitea_token }}@{{ gitea_base }}/powerlevel10k_mirror.git"
repo_syntax: "https://{{ gitea_token }}@{{ gitea_base }}/zsh-syntax-highlighting_mirror.git"
repo_suggest: "https://{{ gitea_token }}@{{ gitea_base }}/zsh-autosuggestions_mirror.git"
tasks:
- name: Установка пакета zsh
apt:
name:
- zsh
#- git
state: present
update_cache: yes
tags: [always]
- name: "Копируем эталонный конфиг zprofile для применения /etc/profile.d/* файлов"
copy:
src: ../../../files/zprofile
dest: "/etc/zsh/zprofile"
owner: root
group: root
mode: '0644'
tags: [always]
- name: Creates directory /root/adm
ansible.builtin.file:
path: "/root/adm"
state: directory
group: "root"
owner: "root"
# script
- name: "Проставляем /root/adm/rm-orphaned-zshes.sh"
copy:
src: ../../../files/zsh/rm-orphaned-zshes.sh
dest: "/root/adm/rm-orphaned-zshes.sh"
owner: root
group: root
mode: '0744'
tags: [always]
# service
- name: "Проставляем /etc/systemd/system/rm-orphaned-zshes.service"
copy:
src: ../../../files/zsh/rm-orphaned-zshes.service
dest: "/etc/systemd/system/rm-orphaned-zshes.service"
owner: root
group: root
mode: '0644'
tags: [always]
# service
- name: "Проставляем /etc/systemd/system/rm-orphaned-zshes.timer"
copy:
src: ../../../files/zsh/rm-orphaned-zshes.timer
dest: "/etc/systemd/system/rm-orphaned-zshes.timer"
owner: root
group: root
mode: '0644'
tags: [always]
- name: Перечитать конфигурацию systemd и запустить таймер
ansible.builtin.systemd:
name: "rm-orphaned-zshes.timer"
state: started
enabled: true
daemon_reload: true
tags: [always]
- name: Накат ZSH и плагинов для каждого пользователя
include_tasks: user-tasks.yml
loop: "{{ zsh_users }}"
loop_control:
loop_var: current_user
tags: [always]