How do I install and use an Ansible collection within an AWX playbook at run time?

36 Views Asked by At

Firstly, I'm new to AWX (like very new!) so this is probably something very simple, but just beyond my ability to solve.

I'm currently writing a playbook to run in AWX to test whether a host has been deployed correctly (I'm aware of the idempotency, etc of Ansible, but we have a requirement to demonstrate test coverage).

My problem is simple, I have a playbook which I'm using to test a Windows VM. I want to retrieve a list of the installed Windows updates. I know I can use the win_updates collection (https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_updates_module.html), but I cannot seem to get it to install.

I've tried using:

roles:
  - role: ansible.windows.win_updates

Alas this hasn't worked and I'm not able to use a requirements.yml file (and don't rightly know how in the context of the playbook).

Any help would be good as I'm finding the ansible/AWX documentation particularly useless.

0

There are 0 best solutions below