boma/roles/dev_env/molecule/default/verify.yml
sjat aea4f8c3d6 dev_env: install Node.js from pinned tarball, drop npm bloat
Debian's npm package pulls a ~400-package node-* tree (the first deploy
installed 527 packages). Replace apt nodejs+npm with a pinned upstream Node
tarball (v20.19.2) installed to /opt + symlinked, mirroring the nvim install
pattern (ADR-014 pinning). npm/npx come bundled. Molecule verifies node/npm
on PATH; lint + idempotent converge green.

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

73 lines
2.3 KiB
YAML

---
- name: Verify
hosts: all
become: true
gather_facts: false
tasks:
- name: Gather installed-package facts
ansible.builtin.package_facts:
manager: apt
- name: Assert core packages are present
ansible.builtin.assert:
that:
- "'zsh' in ansible_facts.packages"
- "'tmux' in ansible_facts.packages"
- "'stow' in ansible_facts.packages"
- "'direnv' in ansible_facts.packages"
fail_msg: core dev_env packages missing
- name: Stat system binaries and theme
ansible.builtin.stat:
path: "{{ item }}"
loop:
- /usr/local/bin/nvim
- /usr/local/bin/oh-my-posh
- /usr/local/bin/node
- /usr/local/bin/npm
- /etc/oh-my-posh/zen.toml
register: dev_env__sys
loop_control:
label: "{{ item }}"
- name: Assert system tools are installed
ansible.builtin.assert:
that:
- dev_env__sys.results | map(attribute='stat.exists') | min
fail_msg: a system tool (nvim/oh-my-posh/node/npm/zen.toml) is missing
- name: Look up the test user
ansible.builtin.getent:
database: passwd
key: tester
- name: Assert tester login shell is zsh
ansible.builtin.assert:
that:
- "getent_passwd['tester'][5] == '/usr/bin/zsh'"
fail_msg: tester login shell was not set to zsh
- name: Stat tester dotfiles and frameworks
ansible.builtin.stat:
path: "{{ item }}"
loop:
- /home/tester/.zshrc
- /home/tester/.tmux.conf
- /home/tester/.config/nvim/init.lua
- /home/tester/.oh-my-zsh
- /home/tester/.tmux/plugins/tpm
register: dev_env__dots
loop_control:
label: "{{ item }}"
- name: Assert dotfiles are stowed (symlinks) and frameworks cloned
ansible.builtin.assert:
that:
- dev_env__dots.results[0].stat.exists
- dev_env__dots.results[0].stat.islnk
- dev_env__dots.results[1].stat.exists
- dev_env__dots.results[1].stat.islnk
- dev_env__dots.results[2].stat.exists
- dev_env__dots.results[3].stat.exists
- dev_env__dots.results[4].stat.exists
fail_msg: dotfiles not stowed or omz/tpm not cloned