Why Am I Getting an Error "ERROR! couldn't resolve module/action 'postgresql_query'. This often indicates a misspelling, missing collection, or incorrect module path " while running the Ansible Automation Platform installer?

Solution Verified - Updated -

Environment

  • Ansible Automation Platform 2.x

Issue

  • Ansible Automation Platform installer fails at the following task while installing or upgrading the AAP environment:

    TASK [include_role : ansible.automation_platform_installer.preflight] **********
    ERROR! couldn't resolve module/action 'postgresql_query'. This often indicates a misspelling, missing collection, or incorrect module path.
    
    The error appears to be in '/var/tmp/ansible-automation-platform-setup-bundle-2.3-1.3/collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/tasks/main.yml': line 150, column 5, but may
    be elsewhere in the file depending on the exact syntax problem.
    
    The offending line appears to be:
    
    - name: Preflight check - Ensure User-Provided Postgres Instance is at Version 12 or Higher
      ^ here
    

Resolution

Diagnostic Steps

  • The error appears because of missing postgresql_* module which causes the installation to fail.

  • Check and compare the missing files under
    {installer_directory}/collections/ansible_collections/community/postgresql/plugins/modules with the newly downloaded AAP installer tarball.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments