Files
ansible-repo/playbooks/software/vim/user_tasks.yml
hogweed1 7329a84c27
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
well,
2026-11-06 00:48:45 +10:00

88 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: "[{{ current_user }}] Фиксируем переменную user_home"
set_fact:
#user_home: "{{ getent_passwd[current_user] }}"
user_home: "{{ '/root' if current_user == 'root' else '/home/' ~ current_user }}"
tags: [always]
- name: Creates directory
ansible.builtin.file:
path: "{{ user_home }}/.vim/pack/plugins/start"
state: directory
group: "{{current_user}}"
owner: "{{current_user}}"
# 0e2d23940d1862ae1558476f39565cd5bb2bcd88
# ansible-stuff token gitea
# ==========================================
# БЛОК 3: НАСТРОЙКА КОНФИГУРАЦИОННЫХ ФАЙЛОВ
# ==========================================
- name: "Финализация конфигурации"
block:
- name: "[{{ current_user }}] Копируем эталонный файл настроек"
copy:
src: ../../../files/.vimrc
dest: "{{ user_home }}/.vimrc"
owner: "{{ current_user }}"
group: "{{ current_user }}"
mode: '0655'
become_user: "{{ current_user }}"
tags: [deploy, update]
# ==========================================
# БЛОК 1: ПЕРВИЧНАЯ РАСКАТКА (БЫСТРЫЙ CLONE)
# ==========================================
- name: "Первичный деплой репозиториев"
block:
- name: "[{{ current_user }}] Клонируем плагин rust-vim"
git:
repo: "{{ repo_rustvim }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/rust.vim"
depth: 1
update: no
- name: "[{{ current_user }}] Клонируем плагин vim-toml"
git:
repo: "{{ repo_tomlvim }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/vim-toml"
depth: 1
update: no
- name: "[{{ current_user }}] Клонируем тему challengerdeep"
git:
repo: "{{ repo_challengerdeep }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/challenger-deep"
depth: 1
update: no
become_user: "{{ current_user }}"
tags: [deploy]
# ==========================================
# БЛОК 2: ОБНОВЛЕНИЕ ДО ПОСЛЕДНИХ ВЕРСИЙ (GIT PULL)
# ==========================================
- name: "Обновление репозиториев"
block:
- name: "[{{ current_user }}] Обновляем плагин rust-vim до latest"
git:
repo: "{{ repo_rustvim }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/rust.vim"
update: yes
- name: "[{{ current_user }}] Обновляем плагин vim-toml до latest"
git:
repo: "{{ repo_tomlvim }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/vim-toml"
update: yes
- name: "[{{ current_user }}] Обновляем тему challengerdeep до latest"
git:
repo: "{{ repo_challengerdeep }}"
dest: "{{ user_home }}/.vim/pack/plugins/start/challenger-deep"
update: yes
become_user: "{{ current_user }}"
tags: [update]