Run a playbook on AWX that uses the win_chocolatey module to install packages on a Windows host via WinRM

I am trying to run a playbook on my AWX server targeting my Windows host via WinRM, but it is failing.

  • I configured the inventory, credentials, hosts, projects, and templates (I am new to AWX, so I might have made a mistake, but I followed a tutorial, so I believe the setup is correct).
  • After that, I ran a playbook to ping the Windows host, and it worked. However, when I tried running another playbook using Chocolatey (used for Windows package installations), it failed with the error:
    “ERROR! unable to resolve module/action ‘community.windows.win_chocolatey’. This often indicates a misspelling, missing collection, or incorrect module path.”
  • I am using the latest version of AWX.
---
- name: Example usage of win_chocolatey module on AWX
  hosts: all
  become: false
  gather_facts: false
  vars:
    packages:
      - git
      - notepadplusplus
  tasks:
    - name: Install packages using Chocolatey
      community.windows.win_chocolatey:
        name: "{{ packages }}"
        state: present

Additional Information:

  • I am using GitHub to manage my playbooks and integrating it with AWX.