local/roles/neovim/tasks/Windows.yaml
2023-07-25 20:43:04 +01:00

60 lines
1.7 KiB
YAML

---
- name: install chocolatey packages
win_chocolatey:
name: neovim
state: latest
- set_fact:
vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim'
# - name: clone config repo
# win_git:
# repo: git@code.infektor.net:config/vim.git
# dest: '{{vim_config_dir}}'
# branch: master
# # clone: false
# update: true
# - win_owner:
# path: '{{vim_config_dir}}'
# user: Benie
# recurse: true
# - TODO: neovim set repo email
# win_git_config:
# - TODO: neovim install pip packages
# win_pip:
# name: '{{neovim_pip_packages}}'
# state: latest
- name: create nvim start menu shortcut
win_shortcut:
src: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/nvim-qt.lnk'
icon: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe,0'
directory: '{{ansible_env.USERPROFILE}}'
- name: check for config repo tasks.yaml
win_stat:
path: '{{vim_config_dir}}/tasks.yaml'
register: config_repo_tasks
# TODO: this doesn't work for non localhost setups
# probably need to copy the tasks.yaml and plugins.yaml to the controller in a
# temporary directory then include them
- when: config_repo_tasks.stat.exists
fetch:
src: '{{vim_config_dir}}/tasks.yaml'
dest: vim_config_tasks.yaml
flat: true
- when: config_repo_tasks.stat.exists
include_tasks: vim_config_tasks.yaml
- when: ansible_os_family != "Windows" and
plugin_dir is defined and plugins is defined
include_tasks: 'Unix-plugins.yaml'
- when: ansible_os_family == "Windows" and
plugin_dir is defined and plugins is defined
include_tasks: 'Windows-plugins.yaml'