PHP Version issue after trellis update


We’ve recently tried upgrading trellis to v1.17.0 and are getting an issue when trying to provision new servers.

Running command => ansible-playbook server.yml -e env=staging
ERROR! couldn't resolve module/action 'community.general.alternatives'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/media/username/Work/': line 17, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Ensure correct PHP version selected
  ^ here
exit status 4

Any advice in tracking down whatever outdated files we might still have and debugging this?

Can you run ansible-playbook --version? My guess is that the module is newer than your ansible version.

Ref: community.general.alternatives module – Manages alternative programs for common commands — Ansible Documentation

This module is part of the community.general collection (version 5.6.0).

Thank you, I’d forgotten to delete and re-run trellis init

1 Like