This is most definitely NOT the way to use AWX! No one should be querying the database directly.
Check whether KBs are discovered through gather_fact discovery on your windows hosts first off with
ansible winhost.example.com -m setup
Will give you the complete list. Put that in a playbook and run whenever you like to get an up-to-date list.
Its successfully outputting the system info and much more detailed information, but not the KB Installed for a particular system.
My requirement is like:
I am running a windowsPatching playbook against a list of hosts like 50 of them to patch them. So I just want to figure out a particular patch with KBNumber for eg:KB4049065 is installed on how many of those 50 systems. Because logging into every machine and checking the KBNumber would not be meaningful.
That was the reason I asked for whether we can query the db or not.
Any other mehod or solution will also be fine for me. For the above requirement.
So if the KB information isn’t coming back as facts it’s not going to be in the AWX DB.
You’re better off writing a playbook which queries the windows hosts (you might need a little powershell to do this?) and reports that back somewhere, maybe a html file.
That way, you can run to get the up-to-date information regularly as things change. If you use a survey, then you could pass in the KB to be checked.
Make the task repeatable, that’s the point of Ansible
Based on what you told.I did exactly the same . I wrote one powershell script to check the KB number ,ran it using playbook and its working fine.
But do i have to do the same for every requirement which comes ie write one powershell script and run it using ansible playbook. Because at later point of time some more different requirement may comes.
So,was just wondering isn’t it would be great if we can query the Database instead, for the stored data.