77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
---
|
||
# tasks file for ohmyposh_theme
|
||
|
||
- name: Загружаем oh-my-posh
|
||
get_url:
|
||
url: "{{ oh_my_posh_download_url }}"
|
||
dest: /home/{{ user_for_ohmyposh }}/oh-my-posh
|
||
mode: '0755'
|
||
|
||
- name: Перемещаем oh-my-posh в /usr/local/bin
|
||
command: mv "/home/{{ user_for_ohmyposh }}/oh-my-posh" /usr/local/bin/oh-my-posh
|
||
|
||
- name: Создание директории для тем
|
||
file:
|
||
path: "/home/{{ user_for_ohmyposh }}/.poshthemes"
|
||
state: directory
|
||
owner: "{{ user_for_ohmyposh }}"
|
||
group: "{{ user_for_ohmyposh }}"
|
||
mode: "0755"
|
||
|
||
- name: Копирование темы в директорию
|
||
copy:
|
||
src: "{{ theme_file }}"
|
||
dest: "{{ theme_path }}"
|
||
owner: "{{ user_for_ohmyposh }}"
|
||
group: "{{ user_for_ohmyposh }}"
|
||
mode: "0644"
|
||
|
||
- name: Обновить .bashrc для инициализации oh-my-posh
|
||
lineinfile:
|
||
path: "/home/{{ user_for_ohmyposh }}/.bashrc"
|
||
line: 'eval "$(oh-my-posh --init --shell bash --config {{ theme_path }})"'
|
||
state: present
|
||
|
||
- name: Загрузить и установить Nerd Fonts
|
||
block:
|
||
- name: Создаем директорию для шрифтов
|
||
file:
|
||
path: "/home/{{ user_for_ohmyposh }}/.local/share/fonts"
|
||
state: directory
|
||
owner: "{{ user_for_ohmyposh }}"
|
||
group: "{{ user_for_ohmyposh }}"
|
||
mode: "755"
|
||
register: fonts_dir
|
||
|
||
- name: ll
|
||
command: "ls -la /home/{{ user_for_ohmyposh }}/.local"
|
||
register: ll
|
||
|
||
- debug:
|
||
var: ll.stdout
|
||
|
||
- debug:
|
||
var: fonts_dir
|
||
|
||
- name: Загружаем архив с шрифтами
|
||
get_url:
|
||
url: "{{ nerd_fonts_url }}"
|
||
dest: "/home/{{ user_for_ohmyposh }}/.local/share/fonts/0xProto.zip"
|
||
owner: "{{ user_for_ohmyposh }}"
|
||
group: "{{ user_for_ohmyposh }}"
|
||
mode: "0644"
|
||
|
||
- name: Распаковываем шрифты
|
||
unarchive:
|
||
src: "/home/{{ user_for_ohmyposh }}/.local/share/fonts/0xProto.zip"
|
||
dest: "/home/{{ user_for_ohmyposh }}/.local/share/fonts/"
|
||
remote_src: yes
|
||
|
||
- name: Обновляем кэш шрифтов
|
||
command: fc-cache -fv
|
||
changed_when: false
|
||
|
||
- name: Применяем изменения в .bashrc
|
||
command: source "/home/{{ user_for_ohmyposh }}/.bashrc"
|
||
changed_when: false
|