Skip to content

Add CI workflow for Ansible playbook validation#79

Merged
michaelbarton merged 6 commits intomasterfrom
claude/merge-master-fix-checks-5mJ6K
Mar 10, 2026
Merged

Add CI workflow for Ansible playbook validation#79
michaelbarton merged 6 commits intomasterfrom
claude/merge-master-fix-checks-5mJ6K

Conversation

@michaelbarton
Copy link
Owner

Summary

This PR adds GitHub Actions CI workflow to validate the Ansible playbook and refactors the Neovim npm package installation task.

Key Changes

  • New CI Workflow (.github/workflows/ansible.yml):

    • Added automated testing on every push
    • Sets up Ubuntu environment with required dependencies (Python 3.11, Neovim, uv)
    • Creates necessary stub files and directories for excluded configuration files
    • Validates playbook syntax using ansible-playbook --syntax-check
    • Runs the full playbook with macOS-specific tasks skipped
  • Neovim Task Refactor (ansible/tasks/neovim.yml):

    • Replaced community.general.npm module with ansible.builtin.command for npm install
    • Uses explicit npm install --prefix command for better compatibility and control
    • Maintains same functionality of installing jsonlint in the Neovim virtual environment

Implementation Details

The CI workflow ensures the dotfiles playbook can be validated in a clean environment by:

  • Symlinking the repository to ~/.dotfiles to match expected paths
  • Creating stub files for sensitive configuration (.mise.toml, SSH config) that are excluded from version control
  • Using uvx to run Ansible without requiring a persistent installation
  • Skipping macOS-specific tasks (tagged with agents) during Linux CI execution

https://claude.ai/code/session_01Aitqk4swbLaSiz16qaJrTv

claude and others added 6 commits March 1, 2026 23:55
Removes the dependency on the community.general collection which
was producing a warning about not supporting the installed Ansible
version. Uses npm install --prefix directly instead.

https://claude.ai/code/session_01Vm5EEsQ5uFKoni6qWEDQd8
Runs the full playbook (minus macOS-only launch agents) on
ubuntu-latest: syntax check then an actual apply. Installs
Neovim, Python 3.11, and virtualenv so the neovim setup tasks
(pip venv, Lazy sync, treesitter) can run too.

https://claude.ai/code/session_01Vm5EEsQ5uFKoni6qWEDQd8
uv run ansible-playbook fails in CI because ansible-core is not
installed as a project dependency.  Switch to uvx --from ansible-core
which auto-installs ansible-core in an isolated environment.

https://claude.ai/code/session_01Aitqk4swbLaSiz16qaJrTv
These files are not checked into git, so the CI had to create stubs
just to prevent symlink failures. Simpler to manage them outside
ansible since they are local-only configuration.

https://claude.ai/code/session_01Aitqk4swbLaSiz16qaJrTv
- Use python3 -m venv instead of virtualenv for venv creation, removing
  the virtualenv dependency and the pip install step from CI
- Add force: true to symlink task so existing files (e.g. .bashrc,
  .gitconfig on Ubuntu runners) get replaced with symlinks

https://claude.ai/code/session_01Aitqk4swbLaSiz16qaJrTv
@michaelbarton michaelbarton merged commit ad24099 into master Mar 10, 2026
2 checks passed
@michaelbarton michaelbarton deleted the claude/merge-master-fix-checks-5mJ6K branch March 10, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants