Interview Prep/Ansible/Roles, Collections and Galaxy

`Unsupported parameters for (community.general.ufw) module: comment. Supported parameters include: ...`

IntermediateTroubleshootingRoles, Collections and Galaxy
Answer

Likely causes → The parameter was added in a newer collection version than the one installed. The bundled ansible package may carry an older community.general than the docs you are reading. An indentation mistake that puts a task keyword under the module gives the same error.

Diagnose →

ansible-galaxy collection list community.general
ansible-doc community.general.ufw | grep -A3 comment

Fix → Upgrade the collection (ansible-galaxy collection install community.general --upgrade, or bump the version pin), or drop the parameter.

Prevent → Read the docs matching your installed version (ansible-doc is always correct), and pin collection versions.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy