boma/roles/dev_env/tasks/neovim.yml
sjat f3f382ae69 Add dev_env role: zsh/tmux/nvim for workstation-class hosts
A new role (separate from base) that gives workstation-class hosts (ubongo
now, mamba later) a clean interactive environment: zsh + oh-my-zsh +
oh-my-posh, tmux + TPM plugins, and neovim. Dotfiles are real files deployed
via GNU stow (not templated); pinned nvim v0.12.2 + oh-my-posh 29.0.1.

Configs re-derived (ADR-013) from AnsibleBaobabV4 + the operator's fisi setup
on boma's terms: no Nerd Font (headless host), no system LSP suite (nvim uses
mason), versions pinned (V4 tracks latest). Applied via playbooks/workstation.yml
to the control group for users sjat + claude. Lint + Molecule (idempotent) green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 13:50:11 +02:00

52 lines
1.7 KiB
YAML

---
- name: Neovim | Read installed-version sentinel
ansible.builtin.slurp:
src: /etc/nvim_installed_version
register: dev_env__nvim_sentinel
failed_when: false
- name: Neovim | Determine installed version
ansible.builtin.set_fact:
dev_env__nvim_installed: >-
{{ (dev_env__nvim_sentinel.content | b64decode | trim)
if dev_env__nvim_sentinel.content is defined else '' }}
- name: Neovim | Install pinned release
when: dev_env__nvim_installed != dev_env__nvim_version
block:
- name: Neovim | Download release tarball
ansible.builtin.get_url:
url: "https://github.com/neovim/neovim/releases/download/{{ dev_env__nvim_version }}/nvim-linux-x86_64.tar.gz"
dest: "/tmp/nvim-{{ dev_env__nvim_version }}.tar.gz"
mode: "0644"
- name: Neovim | Create versioned install directory
ansible.builtin.file:
path: "/opt/nvim-{{ dev_env__nvim_version }}"
state: directory
mode: "0755"
- name: Neovim | Extract tarball
ansible.builtin.unarchive:
src: "/tmp/nvim-{{ dev_env__nvim_version }}.tar.gz"
dest: "/opt/nvim-{{ dev_env__nvim_version }}"
remote_src: true
extra_opts: ["--strip-components=1"]
- name: Neovim | Symlink into PATH
ansible.builtin.file:
src: "/opt/nvim-{{ dev_env__nvim_version }}/bin/nvim"
dest: /usr/local/bin/nvim
state: link
force: true
- name: Neovim | Write version sentinel
ansible.builtin.copy:
content: "{{ dev_env__nvim_version }}"
dest: /etc/nvim_installed_version
mode: "0644"
- name: Neovim | Remove downloaded tarball
ansible.builtin.file:
path: "/tmp/nvim-{{ dev_env__nvim_version }}.tar.gz"
state: absent