This commit is contained in:
87
playbooks/software/vim/user-tasks.yml
Normal file
87
playbooks/software/vim/user-tasks.yml
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
- 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]
|
||||
Reference in New Issue
Block a user