Skip to content

Ansible

Ansible CI on GitHub Actions

Collection and role installation runs before every playbook.

50s → 3s
Galaxy install

Collection and role installation runs before every playbook.

Why it happens

~/.ansible/collections is not cached, so Galaxy is queried on every run.

What to change

  1. Cache ~/.ansible/collections keyed on requirements.yml
  2. Run ansible-lint in a parallel job rather than serially
  3. Use --check mode in pull requests and apply only on merge

Ansible on runnerhut

yaml
jobs:
lint:
runs-on: runnerhut-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- run: ansible-galaxy install -r requirements.yml
- run: ansible-lint
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-2vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.